From 4119bff4842ec6513134f24bfda2cfcdcabc39bd Mon Sep 17 00:00:00 2001 From: PixelRunner <73481403+PixelRunnerWasTaken@users.noreply.github.com> Date: Wed, 30 Oct 2024 19:52:12 -0500 Subject: [PATCH] Use W, A, D, and Space keys for movement --- classes/Input.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/Input.py b/classes/Input.py index 72f4c564..7a1d9bf0 100644 --- a/classes/Input.py +++ b/classes/Input.py @@ -18,14 +18,14 @@ def checkForInput(self): def checkForKeyboardInput(self): pressedKeys = pygame.key.get_pressed() - if pressedKeys[K_LEFT] or pressedKeys[K_h] and not pressedKeys[K_RIGHT]: + if pressedKeys[K_LEFT] or pressedKeys[K_h] or pressedKeys[K_a] and not pressedKeys[K_RIGHT] and not pressedKeys[K_d]: self.entity.traits["goTrait"].direction = -1 - elif pressedKeys[K_RIGHT] or pressedKeys[K_l] and not pressedKeys[K_LEFT]: + elif pressedKeys[K_RIGHT] or pressedKeys[K_l] or pressedKeys[K_d] and not pressedKeys[K_LEFT] and not pressedKeys[K_a]: self.entity.traits["goTrait"].direction = 1 else: self.entity.traits['goTrait'].direction = 0 - isJumping = pressedKeys[K_SPACE] or pressedKeys[K_UP] or pressedKeys[K_k] + isJumping = pressedKeys[K_SPACE] or pressedKeys[K_UP] or pressedKeys[K_k] or pressedKeys[K_w] or pressedKeys[K_SPACE] self.entity.traits['jumpTrait'].jump(isJumping) self.entity.traits['goTrait'].boost = pressedKeys[K_LSHIFT]