GameStates introduced
This commit is contained in:
parent
f02158833c
commit
b7aff68e3a
7 changed files with 40 additions and 12 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use bevy::prelude::*;
|
||||
|
||||
use crate::projectile::spawn_projectile;
|
||||
use crate::GameState;
|
||||
|
||||
pub mod enemy;
|
||||
pub mod player;
|
||||
|
|
@ -39,11 +39,11 @@ pub struct ShipsPlugin;
|
|||
impl Plugin for ShipsPlugin {
|
||||
fn build(&self, app: &mut bevy::app::App) {
|
||||
app.insert_resource(Time::<Fixed>::from_hz(60.))
|
||||
.add_systems(Startup, startup)
|
||||
.add_systems(OnEnter(GameState::Game), startup)
|
||||
.add_systems(
|
||||
FixedUpdate,
|
||||
(
|
||||
player::player_movement_system,
|
||||
player::player_movement_system.run_if(in_state(GameState::Game)),
|
||||
player::player_shooting_system,
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue