Simulation now (sort of) respects the match-state

This commit is contained in:
2025-12-11 18:01:26 +01:00
parent 1d414cc392
commit 80cdeb5baf
4 changed files with 182 additions and 123 deletions

View File

@@ -196,9 +196,14 @@ bool game_session_enqueue_player_input(Game_Session *session, uint16_t player_in
assert(player != NULL);
if(simulation_input_equal(player->most_recent_input, input)) {
// Ignore 'input' if it's equal to the most recent input. This way we avoid duplicates.
return false;
}
// TODO: SS - Check if 'input' is a valid "snake-move".
// Inputting right when going left will sadly be "okay" here which will make the game
// feel less responsive.
if(!squeue_push(&player->input_queue, (void *)&input)) {
return false;
}