Permalink
Browse files

Restart game by pressing `n` in endgame screen

We can't use F5 in wasm.
  • Loading branch information...
tomassedovic committed Dec 21, 2017
1 parent fdbc828 commit 0195b2763b4a486478daf4c49cabdc55c6c76ba1
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/game.rs
  2. +1 −1 src/render.rs
@@ -70,7 +70,7 @@ pub fn update(
}

// Restart the game on F5
if state.keys.matches_code(KeyCode::F5) {
if state.keys.matches_code(KeyCode::F5) || state.endgame_screen_visible && state.keys.matches_code(KeyCode::N) {
let state = State::new_game(
state.world_size,
state.map_size.x,
@@ -243,7 +243,7 @@ fn render_endgame_screen(state: &State, drawcalls: &mut Vec<Draw>) {
"Longest High streak: {} turns",
state.player.longest_high_streak
);
let keyboard_text = "[F5] New Game [Q] Quit";
let keyboard_text = "[N] New Game [Q] Quit";

let longest_text = [
endgame_reason_text,

0 comments on commit 0195b27

Please sign in to comment.