persist level timer

This commit is contained in:
Evan Pratten 2021-10-03 11:26:07 -04:00
parent f77373df62
commit f549cab250
2 changed files with 3 additions and 2 deletions

View File

@ -109,7 +109,7 @@ restart the level. If problems continue, simply get good.
*** C [libraylib.so+0x75c] END_DRAWING() *** C [libraylib.so+0x75c] END_DRAWING()
*** RS [data_loss.so+0x48f] validate_player() *** RS [data_loss.so+0x48f] validate_player()
*** --------------------------------------- *** ---------------------------------------
*** PROGRAM_HALT (TIME: XX:XX, BEST: XX:XX) *** PROGRAM_HALT (TIMER: {}:{})
*** ---------------------------------------", *** ---------------------------------------",
25, 25,
20, 20,

View File

@ -69,7 +69,6 @@ impl Action<Scenes, ScreenError, GameContext> for InGameScreen {
// Handle cleanup after death // Handle cleanup after death
self.player_dead = false; self.player_dead = false;
self.player.reset(); self.player.reset();
self.level_switch_timestamp = Utc::now();
// Set the player to running // Set the player to running
let cur_level = self.levels.get(context.current_level).unwrap(); let cur_level = self.levels.get(context.current_level).unwrap();
@ -140,6 +139,8 @@ impl Action<Scenes, ScreenError, GameContext> for InGameScreen {
.flag_send .flag_send
.send(Some(ControlFlag::SwitchLevel(self.current_level_idx + 1))) .send(Some(ControlFlag::SwitchLevel(self.current_level_idx + 1)))
.unwrap(); .unwrap();
// TODO: This is where the timer should reset and publish state
return Ok(ActionFlag::SwitchState(Scenes::NextLevelScreen)); return Ok(ActionFlag::SwitchState(Scenes::NextLevelScreen));
} }
} }