From 34bc0de2581968ee9fea0d03d453978154d541b7 Mon Sep 17 00:00:00 2001 From: Adam Doyle Date: Fri, 15 Nov 2024 06:34:32 -0500 Subject: [PATCH] hjkl --- snek.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/snek.py b/snek.py index 823faf1..6555475 100644 --- a/snek.py +++ b/snek.py @@ -69,13 +69,29 @@ class Snek: pygame.quit() sys.exit() elif event.type == pygame.KEYDOWN: - if event.key == pygame.K_UP or event.key == pygame.K_w: + if ( + event.key == pygame.K_UP + or event.key == pygame.K_w + or event.key == pygame.K_k + ): self.turn(UP) # all da way - elif event.key == pygame.K_DOWN or event.key == pygame.K_s: + elif ( + event.key == pygame.K_DOWN + or event.key == pygame.K_s + or event.key == pygame.K_j + ): self.turn(DOWN) # for what? - elif event.key == pygame.K_LEFT or event.key == pygame.K_a: + elif ( + event.key == pygame.K_LEFT + or event.key == pygame.K_a + or event.key == pygame.K_h + ): self.turn(LEFT) - elif event.key == pygame.K_RIGHT or event.key == pygame.K_d: + elif ( + event.key == pygame.K_RIGHT + or event.key == pygame.K_d + or event.key == pygame.K_l + ): self.turn(RIGHT)