game states cleanup

This commit is contained in:
2026-09-19 11:32:24 +02:00
parent f2f3e5c76c
commit 05616061ed
5 changed files with 19 additions and 12 deletions
+2
View File
@@ -16,6 +16,7 @@ pub struct Collider {
pub fn check_collision_with_player(
player: Single<(&Transform, &Collider, &mut Sprite), With<Player>>,
obstacle: Query<(&Transform, &Collider), With<Obstacle>>,
mut next_state: ResMut<NextState<GameState>>,
) {
let (player_transform, player_collider, mut _player_sprite) = player.into_inner();
@@ -28,6 +29,7 @@ pub fn check_collision_with_player(
collider_collider.size / 2.0,
) {
// player_sprite.color = Color::srgb(1.0, 0.0, 0.0); // Change sprite color
next_state.set(GameState::GameOver);
break;
}
}