Moved code and assets for the game to a seperate folder. Moved jansson and raylib to third_party.
This commit is contained in:
29
src/game/simulation/input.h
Normal file
29
src/game/simulation/input.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef SIM_GAME_INPUT_H
|
||||
#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;
|
||||
}
|
||||
if(a.left != b.left) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user