1 #include "../game/game.h"
3 enum direction last_player_move;
5 void move_player(enum direction dir)
10 dir_to_xy(dir, &x, &y);
11 last_player_move = dir;
21 static void move_left()
26 static void move_down()
31 static void move_right()
36 __attribute__((constructor)) static void init()
38 register_input_handler('w', (struct input_handler) {
43 register_input_handler('a', (struct input_handler) {
45 .callback = &move_left,
48 register_input_handler('s', (struct input_handler) {
50 .callback = &move_down,
53 register_input_handler('d', (struct input_handler) {
55 .callback = &move_right,