Skip to content

Commit

Permalink
Improve first and last round
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmauro committed Apr 4, 2024
1 parent b26a84e commit c02d7c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/game/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ impl Plugin for GamePlugin {
.add_plugins(InputPlugin)
.add_plugins(GameButtonPlugin)
.add_systems(OnEnter(AppState::Game), setup)
.add_systems(
PreUpdate,
end_of_game_system.run_if(in_state(AppState::Game)),
)
.add_systems(
Update,
(timer_system, end_of_round_system, end_of_game_system)
.run_if(in_state(AppState::Game)),
(timer_system, end_of_round_system).run_if(in_state(AppState::Game)),
)
.add_systems(OnExit(AppState::Game), despawn_screen::<OnGameScreen>);
}
Expand Down Expand Up @@ -143,7 +146,9 @@ fn setup(

// start with a cue
let mut timer = CueTimer::with_duration(settings.round_time);
timer.tick(Duration::from_secs_f32(settings.round_time - 0.1));
timer.tick(Duration::from_millis(
((settings.round_time * 1000.0) as u64) - 1,
));

// game
commands.spawn((
Expand Down
2 changes: 1 addition & 1 deletion src/game/tile/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl From<&TileColor> for Color {
TileColor::C => config::TILE_COLOR_C,
TileColor::D => config::TILE_COLOR_D,
TileColor::E => config::TILE_COLOR_E,
TileColor::None => Color::rgb(0.0, 0.0, 0.0),
TileColor::None => config::TILE_COLOR_C,
}
}
}

0 comments on commit c02d7c7

Please sign in to comment.