From c2183e3bf7c2964c025b8ea370d991c11b29b9a0 Mon Sep 17 00:00:00 2001 From: "Waylon S. Walker" Date: Fri, 6 Jan 2023 09:37:51 -0600 Subject: [PATCH] add arrow key support --- creeper_adventure/creeper.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/creeper_adventure/creeper.py b/creeper_adventure/creeper.py index c255ca9..7fba582 100755 --- a/creeper_adventure/creeper.py +++ b/creeper_adventure/creeper.py @@ -449,13 +449,13 @@ class Creeper(Game): def normal_keys(self): keys = self.keys - if keys[pygame.K_a]: + if keys[pygame.K_a] or keys[pygame.K_LEFT]: self.x -= 10 - if keys[pygame.K_d]: + if keys[pygame.K_d] or keys[pygame.K_RIGHT]: self.x += 10 - if keys[pygame.K_w]: + if keys[pygame.K_w] or keys[pygame.K_UP]: self.y -= 10 - if keys[pygame.K_s]: + if keys[pygame.K_s] or keys[pygame.K_DOWN]: self.y += 10 if keys[pygame.K_k]: self.hotbar.next(1)