From cf1dcee5a5184dcb8764f20ef70f3bcd7c5e39c3 Mon Sep 17 00:00:00 2001 From: Adam <24621027+WhiteDopeOnPunk@users.noreply.github.com> Date: Fri, 30 Sep 2022 17:43:59 -0400 Subject: [PATCH] wasd --- snek.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/snek.py b/snek.py index d6f3d2b..9df3379 100644 --- a/snek.py +++ b/snek.py @@ -18,7 +18,7 @@ class Snek(): return else: self.direction = point - + def move(self): cur = self.get_head_position() x, y = self.direction @@ -50,13 +50,13 @@ class Snek(): pygame.quit() sys.exit() elif event.type == pygame.KEYDOWN: - if event.key == pygame.K_UP: + if event.key == pygame.K_UP or event.key == pygame.K_w: self.turn(UP) # all da way - elif event.key == pygame.K_DOWN: + elif event.key == pygame.K_DOWN or event.key == pygame.K_s: self.turn(DOWN) # for what? - elif event.key == pygame.K_LEFT: + elif event.key == pygame.K_LEFT or event.key == pygame.K_a: self.turn(LEFT) - elif event.key == pygame.K_RIGHT: + elif event.key == pygame.K_RIGHT or event.key == pygame.K_d: self.turn(RIGHT) class Food(): @@ -111,7 +111,7 @@ def main(): snek = Snek() food = Food() - + fontSize = 18 scoreFont = pygame.font.SysFont("monospace", fontSize) scoreColor = (255, 255, 255) @@ -141,4 +141,4 @@ def main(): pygame.display.update() -main() \ No newline at end of file +main()