mirror of
https://codeberg.org/schrottkatze/mgd2-tram-championships.git
synced 2025-07-03 10:37:39 +00:00
do a basic scene and way too much organization and fail to implement panning
This commit is contained in:
parent
08069c9224
commit
6d269d0c14
6 changed files with 156 additions and 29 deletions
23
src/game.rs
Normal file
23
src/game.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
use bevy::prelude::*;
|
||||
|
||||
use crate::{
|
||||
AppState,
|
||||
cleanup::{self, despawn},
|
||||
};
|
||||
|
||||
mod camera;
|
||||
mod scene;
|
||||
|
||||
/// Gameplay system set. All functions in this control the gameplay (duh).
|
||||
#[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)]
|
||||
struct GameplaySet;
|
||||
|
||||
pub fn plugin(app: &mut App) {
|
||||
app.add_plugins(camera::plugin)
|
||||
.add_systems(OnEnter(AppState::Ingame), scene::setup.in_set(GameplaySet))
|
||||
.add_systems(
|
||||
OnExit(AppState::Ingame),
|
||||
despawn::<cleanup::Scene>.in_set(GameplaySet),
|
||||
);
|
||||
app.configure_sets(Update, GameplaySet.run_if(in_state(AppState::Ingame)));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue