diff --git a/README.md b/README.md index 9c4edd6..4345fb9 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ a game for the bevy jam 4 - [ ] presentation (lun) - [ ] write readme - [ ] write jam page - - [ ] presubmit game + - [ ] submit game - [ ] would be nice (???) - [x] animations diff --git a/src/spirits.rs b/src/spirits.rs index 265462c..fea5234 100644 --- a/src/spirits.rs +++ b/src/spirits.rs @@ -175,11 +175,12 @@ fn check_lose_count( mut cmd: Commands, mut state: ResMut>, assets: Res, - mut start: Query<(&TilePos, &mut StartTile)>, + end_timer: Res, + mut start: Query<(&TilePos, &mut TileColor, &mut StartTile)>, mut text: Query<&mut Text, With>, tilemap: Query<(&TilemapLayer, &TilemapGridSize, &TilemapType, &Transform)>, ) { - for (pos, mut start) in start.iter_mut() { + for (pos, mut color, mut start) in start.iter_mut() { let lose_text = start.lose_text; if lose_text.is_none() { @@ -214,6 +215,19 @@ fn check_lose_count( if let Ok(mut text) = text.get_mut(lose_text.unwrap()) { let remainder = (LOSE_COUNT - start.lose_counter) / 2. - 3.; + + if remainder <= 5. { + if end_timer.0.finished() { + *color = TileColor(if color.0 == Color::default() { + Color::rgb(1.0, 0.2, 0.5) + } else { + Color::default() + }); + } + } else { + *color = TileColor(Color::default()); + } + text.sections[0].value = if remainder <= 0. { "!!!".to_string() } else if remainder > 10. { diff --git a/src/tilemap.rs b/src/tilemap.rs index 8f07b15..e2e4128 100644 --- a/src/tilemap.rs +++ b/src/tilemap.rs @@ -313,8 +313,6 @@ fn highlight_tile( } for (mut tex, mut color, mut flip, pos, path, start, foreground) in tiles.iter_mut() { - *color = TileColor::default(); - if let Some(sel_pos) = sel_pos.0 { if sel_pos == *pos && path.is_none() && foreground.is_none() { *tex = TileTextureIndex(1);