diff --git a/a3/game.c b/a3/game.c index e795070..11d744b 100644 --- a/a3/game.c +++ b/a3/game.c @@ -29,6 +29,21 @@ int game_event(struct event* event,void* game){ set_message(msg,10,0); if ( event->type == EVENT_ESC){ // Non zero means finish the loop and stop the game. + + switch (event->key) { + case KEY_LEFT: + game->catx--; + break; + case KEY_RIGHT: + game->catx++; + break; + case KEY_UP: + game->caty--; + break; + case KEY_DOWN: + game->caty++; + break; + } return 1; } // Read game variable and update the eventstate