use gamestates and assetloader
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
use crate::tb_entities::{Platform, PlatformTarget};
|
||||
use crate::{
|
||||
GameState,
|
||||
tb_entities::{Platform, PlatformTarget},
|
||||
};
|
||||
use bevy::{math::ops::sin, prelude::*};
|
||||
use bevy_trenchbroom::class::Target;
|
||||
|
||||
@@ -11,7 +14,8 @@ struct ActivePlatform {
|
||||
|
||||
pub fn plugin(app: &mut App) {
|
||||
app.register_type::<ActivePlatform>();
|
||||
app.add_systems(Update, (init, move_active));
|
||||
app.add_systems(OnEnter(GameState::Playing), init);
|
||||
app.add_systems(Update, move_active.run_if(in_state(GameState::Playing)));
|
||||
}
|
||||
|
||||
fn init(
|
||||
|
||||
Reference in New Issue
Block a user