add arrow key support
This commit is contained in:
parent
9d39d94cd2
commit
c2183e3bf7
1 changed files with 4 additions and 4 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue