diff options
author | P. J. McDermott <pjm@nac.net> | 2013-05-21 17:06:59 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-05-21 17:06:59 (EDT) |
commit | c8de208251c1b4900a659c550c9f898c037dfa32 (patch) | |
tree | 94edb2b45c03ffa4fc078218a89569a88c1ab01e /src | |
parent | 63591cff3055b3dcf27f2ba3a45bf41cb97a0284 (diff) | |
download | cursespong-c8de208251c1b4900a659c550c9f898c037dfa32.zip cursespong-c8de208251c1b4900a659c550c9f898c037dfa32.tar.gz cursespong-c8de208251c1b4900a659c550c9f898c037dfa32.tar.bz2 |
Make both players human.
Diffstat (limited to 'src')
-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; } } } |