Implement basic gun controller
All checks were successful
Basic checks / Basic build-and-test supertask (push) Successful in 7m3s
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:
@@ -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((
|
||||
|
||||
Reference in New Issue
Block a user