commit 606e3a3c614c96d699efa8f96da04c94e8c26e87
parent cd585b34938b53c43ab79b817acd8f1ea93af5c1
Author: Antoine Amarilli <ant.amarilli@free.fr>
Date: Wed, 18 May 2011 00:52:27 -0400
add WASD and arrow keys (thanks, Tast!)
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/continuity.py b/continuity.py
@@ -207,7 +207,9 @@ class Player:
class Level:
codeMap = {104: 'h', 106:'j', 107:'k', 108: 'l', 113: 'q', 72: 'H',
- 74:'J', 75: 'K', 76:'L'}
+ 74:'J', 75: 'K', 76:'L', curses.KEY_LEFT:'h', curses.KEY_DOWN:'j',
+ curses.KEY_UP:'k', curses.KEY_RIGHT:'l', 97: 'H', 115: 'J',
+ 119: 'K', 100: 'L'}
def __init__(self, h, w, x, y):
self.h = h
self.w = w
@@ -401,6 +403,8 @@ curses.init_pair(7, curses.COLOR_WHITE, curses.COLOR_BLACK)
curses.init_pair(8, curses.COLOR_YELLOW, curses.COLOR_BLACK)
curses.init_pair(9, curses.COLOR_MAGENTA, curses.COLOR_MAGENTA)
+stdscr.keypad(1)
+
exit = False
won = False