Changed player-movement. From UP, DOWN, LEFT, RIGHT to LEFT, RIGHT. Turn relative to your snake's head.

This commit is contained in:
2025-12-18 14:09:04 +01:00
parent 5e6b042921
commit 0074ecd57b
4 changed files with 50 additions and 47 deletions

View File

@@ -2,20 +2,11 @@
#define SIM_GAME_INPUT_H
typedef struct {
// Movement can probably just be one byte. For a traditional snake-game, only one directional-input is OK.
bool up;
bool down;
bool right;
bool left;
} Simulation_Game_Input;
static inline bool simulation_input_equal(Simulation_Game_Input a, Simulation_Game_Input b) {
if(a.up != b.up) {
return false;
}
if(a.down != b.down) {
return false;
}
if(a.right != b.right) {
return false;
}