Allow zqsd for moves

This commit is contained in:
Gabriel Augendre 2018-04-30 20:28:56 +02:00
parent 14bc17f91c
commit 9ba1ceff72
No known key found for this signature in database
GPG key ID: F360212F958357D4

View file

@ -52,13 +52,13 @@ def main():
logger.warning('Received QUIT event') logger.warning('Received QUIT event')
return return
if event.type == pglocals.KEYDOWN: if event.type == pglocals.KEYDOWN:
if event.key == pglocals.K_DOWN: if event.key == pglocals.K_DOWN or event.key == pglocals.K_s:
snake.direction = Direction.DOWN snake.direction = Direction.DOWN
elif event.key == pglocals.K_LEFT: elif event.key == pglocals.K_LEFT or event.key == pglocals.K_q:
snake.direction = Direction.LEFT snake.direction = Direction.LEFT
elif event.key == pglocals.K_UP: elif event.key == pglocals.K_UP or event.key == pglocals.K_z:
snake.direction = Direction.UP snake.direction = Direction.UP
elif event.key == pglocals.K_RIGHT: elif event.key == pglocals.K_RIGHT or event.key == pglocals.K_d:
snake.direction = Direction.RIGHT snake.direction = Direction.RIGHT
dirty_rects = snake.move(screen, apple) dirty_rects = snake.move(screen, apple)