Permalink
Browse files

Allow restarting game under wasm

We were ignoring the results and therefore restarting the game didn't
work because we never replaced the old state with the new one.
  • Loading branch information...
tomassedovic committed Dec 21, 2017
1 parent 0195b27 commit 6707b535ac34bc15a310c7f74cd273b3a6f16a16
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/main.rs
@@ -404,6 +404,14 @@ pub fn update(state_ptr: *mut State, dt_ms: u32) {
&mut drawcalls,
);

match result {
game::RunningState::Running => {}
game::RunningState::NewGame(new_state) => {
*state = new_state;
}
game::RunningState::Stopped => {},
}

engine::sort_drawcalls(&mut drawcalls, 0..);

// Each "drawcall" will be 6 u8 values: x, y, char, r, g, b

0 comments on commit 6707b53

Please sign in to comment.