add arrow key support

This commit is contained in:
Waylon Walker 2023-01-06 09:37:51 -06:00
parent 9d39d94cd2
commit c2183e3bf7
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4

View file

@ -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)