add game_over
This commit is contained in:
parent
1ecd054a31
commit
e9379a6a94
5 changed files with 57 additions and 23 deletions
|
|
@ -73,13 +73,14 @@ pub enum AppState {
|
|||
Game,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq, Hash, SubStates, Default)]
|
||||
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, SubStates, Default)]
|
||||
#[source(AppState = AppState::Game)]
|
||||
pub enum GameState {
|
||||
Loading,
|
||||
#[default]
|
||||
Running,
|
||||
Paused,
|
||||
GameOver,
|
||||
}
|
||||
|
||||
/// this is what you should set to change the state. do not read this for scheduling
|
||||
|
|
@ -117,7 +118,9 @@ impl ComputedStates for Phase {
|
|||
|
||||
fn compute(sources: Self::SourceStates) -> Option<Self> {
|
||||
match sources {
|
||||
(_, GameState::Loading, _) | (_, GameState::Paused, _) => None,
|
||||
(_, GameState::Loading, _)
|
||||
| (_, GameState::Paused, _)
|
||||
| (_, GameState::GameOver, _) => None,
|
||||
(_, _, CoreState::Dead) | (_, _, CoreState::Unplaced) => None,
|
||||
(BasePhaseState::Execute { .. }, GameState::Running, CoreState::Placed) => {
|
||||
Some(Self::Execute)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue