Implement basic gun controller
All checks were successful
Basic checks / Basic build-and-test supertask (push) Successful in 7m3s

The spacebar fires the gun, bullets are spawned on top of the ship with
a velocity that sends them forward (relative to the ship).

I still need a despawn mechanism, and a fire rate control. To despawn
things, I'm already planning a `Lifetime` component. For rate of fire,
an additional component will be created and attached to the player ship.
This commit is contained in:
2025-08-10 13:30:42 -05:00
parent dea8a0dc1a
commit 65f28e832f
5 changed files with 55 additions and 5 deletions

View File

@@ -9,6 +9,9 @@ use bevy_rapier2d::prelude::*;
#[derive(Component)]
pub struct Ship;
#[derive(Component)]
pub struct Bullet;
pub fn spawn_player(mut commands: Commands, game_assets: Res<GameAssets>) {
commands
.spawn((