diff options
-rw-r--r-- | src/game.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -68,14 +68,22 @@ input(struct game *g) g->running = 0; } else if (c == ERR) { break; - } else if (c == KEY_LEFT) { + } else if (c == 'a') { g->players[0]->paddle_h.dir = -1; - } else if (c == KEY_RIGHT) { + } else if (c == 'd') { g->players[0]->paddle_h.dir = 1; - } else if (c == KEY_UP) { + } else if (c == 'w') { g->players[0]->paddle_v.dir = -1; - } else if (c == KEY_DOWN) { + } else if (c == 's') { g->players[0]->paddle_v.dir = 1; + } else if (c == KEY_LEFT) { + g->players[1]->paddle_h.dir = -1; + } else if (c == KEY_RIGHT) { + g->players[1]->paddle_h.dir = 1; + } else if (c == KEY_UP) { + g->players[1]->paddle_v.dir = -1; + } else if (c == KEY_DOWN) { + g->players[1]->paddle_v.dir = 1; } } } |