Update 'a3/game.c'
This commit is contained in:
parent
32bb3429fc
commit
9e876b864e
15
a3/game.c
15
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user