diff --git a/oboyrog/input_handler.c b/oboyrog/input_handler.c index 9c9f5f7..b678a91 100644 --- a/oboyrog/input_handler.c +++ b/oboyrog/input_handler.c @@ -1,19 +1,19 @@ #include "input_handler.h" -void handle_input(char input, struct Entity* player) { +void handle_input(char input, Entity* player) { if (input == 'z') { - player->pos.y -= 1; + move_entity(player, NORTH); } else if (input == 's') { - player->pos.y += 1; + move_entity(player, SOUTH); } else if (input == 'd') { - player->pos.x += 1; + move_entity(player, EAST); } else if (input == 'q') { - player->pos.x -= 1; + move_entity(player, WEST); } } \ No newline at end of file diff --git a/oboyrog/input_handler.h b/oboyrog/input_handler.h index e15b590..ad0340a 100644 --- a/oboyrog/input_handler.h +++ b/oboyrog/input_handler.h @@ -3,6 +3,6 @@ #include "entity.h" -void handle_input(char input, struct Entity* player); +void handle_input(char input, Entity* player); #endif \ No newline at end of file