Skip to content

Commit

Permalink
Remove Custom Stages
Browse files Browse the repository at this point in the history
I don't think they're required yet. So far everything seems to order
properly just using the built-in core stages.
  • Loading branch information
zicklag committed Aug 7, 2022
1 parent 1e7031b commit 927f2cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/animation.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ops::Range;

use crate::{GameStage, GameState};
use crate::GameState;
use bevy::{
prelude::*,
sprite::TextureAtlasSprite,
Expand All @@ -15,7 +15,7 @@ pub struct AnimationPlugin;
impl Plugin for AnimationPlugin {
fn build(&self, app: &mut App) {
app.add_system_set_to_stage(
GameStage::Animation,
CoreStage::Last,
ConditionSet::new()
.run_in_state(GameState::InGame)
.with_system(animation_flipping)
Expand Down
27 changes: 11 additions & 16 deletions src/loading.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use bevy::{asset::AssetStage, prelude::*};
use bevy::prelude::*;
use bevy_parallax::ParallaxResource;
use iyes_loopless::{prelude::*, state::NextState};

Expand All @@ -14,7 +14,7 @@ use crate::{
metadata::{BorderImageMeta, FighterMeta, GameMeta, ItemMeta, LevelMeta, Settings},
platform::Storage,
player::{Player, PlayerBundle},
GameStage, GameState, Stats,
GameState, Stats,
};

use bevy::{ecs::system::SystemParam, render::camera::ScalingMode};
Expand Down Expand Up @@ -50,20 +50,15 @@ impl Plugin for LoadingPlugin {

// Configure hot reload
if ENGINE_CONFIG.hot_reload {
app.add_stage_after(
AssetStage::LoadAssets,
GameStage::HotReload,
SystemStage::parallel(),
)
.add_system_to_stage(GameStage::HotReload, hot_reload_game)
.add_system_set_to_stage(
GameStage::HotReload,
ConditionSet::new()
.run_in_state(GameState::InGame)
.with_system(hot_reload_level)
.with_system(hot_reload_fighters)
.into(),
);
app.add_system_to_stage(CoreStage::Last, hot_reload_game)
.add_system_set_to_stage(
CoreStage::Last,
ConditionSet::new()
.run_in_state(GameState::InGame)
.with_system(hot_reload_level)
.with_system(hot_reload_fighters)
.into(),
);
}
}
}
Expand Down
11 changes: 0 additions & 11 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ use crate::{
movement::{LeftMovementBoundary, MovementPlugin},
};

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, StageLabel)]
enum GameStage {
Animation,
HotReload,
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
enum GameState {
LoadingStorage,
Expand Down Expand Up @@ -120,11 +114,6 @@ fn main() {

// Add other systems and resources
app.insert_resource(ClearColor(Color::BLACK))
.add_stage_after(
CoreStage::Update,
GameStage::Animation,
SystemStage::parallel(),
)
.add_loopless_state(GameState::LoadingStorage)
.add_plugin(platform::PlatformPlugin)
.add_plugin(localization::LocalizationPlugin)
Expand Down

0 comments on commit 927f2cb

Please sign in to comment.