Key i added for current level information.

This commit is contained in:
Storm Dragon
2025-02-14 16:21:45 -05:00
parent 0e237d8354
commit 03b59256b2
2 changed files with 16 additions and 12 deletions

View File

@@ -10,16 +10,18 @@ You give an evil grin, oh wait, your a skeleton, your skull is always doing that
Controls
a: move left
d: move right
w: jump
s: duck
For your convenience, there are a couple of bindings for each movement key. They are listed here:
a or left arrow: move left
d or right arrow: move right
w or up arrow: jump
s or down arrow: duck
Control: attack
Space: hold to run.
f: throw jack O'lantern
f or alt: throw jack O'lantern
c: check bone dust
e: Check currently wielded weapon.
h check health
h: check health
i: Information for current level.
j: check jack O'lanterns
l: check lives remaining
Alt+PageDown: Master volume decrease

View File

@@ -66,9 +66,9 @@ class WickedQuest:
pygame.event.pump()
# Update running and ducking states
if keys[pygame.K_s] and not player.isDucking:
if (keys[pygame.K_s] or keys[pygame.K_DOWN]) and not player.isDucking:
player.duck()
elif not keys[pygame.K_s] and player.isDucking:
elif (not keys[pygame.K_s] and not keys[pygame.K_DOWN]) and player.isDucking:
player.stand()
player.isRunning = keys[pygame.K_SPACE]
@@ -80,11 +80,11 @@ class WickedQuest:
movementDistance = 0
# Horizontal movement
if keys[pygame.K_a]: # Left
if keys[pygame.K_a] or keys[pygame.K_LEFT]: # Left
movementDistance = currentSpeed
player.xPos -= currentSpeed
player.facingRight = False
elif keys[pygame.K_d]: # Right
elif keys[pygame.K_d] or keys[pygame.K_RIGHT]: # Right
movementDistance = currentSpeed
player.xPos += currentSpeed
player.facingRight = True
@@ -102,11 +102,13 @@ class WickedQuest:
speak(f"{player.get_coins()} gbone dust")
if keys[pygame.K_h]:
speak(f"{player.get_health()} health of {player.get_max_health()}")
if keys[pygame.K_i]:
speak(f"Level {self.currentLevel.levelId}, {self.currentLevel.levelName}. {player.get_health()} health of {player.get_max_health()}. {player.get_lives()} lives remaining.")
if keys[pygame.K_l]:
speak(f"{player.get_lives()} lives")
if keys[pygame.K_j]: # Check jack o'lanterns
speak(f"{player.get_jack_o_lanterns()} jack o'lanterns")
if keys[pygame.K_f]:
if keys[pygame.K_f] or keys[pygame.K_LALT] or keys[pygame.K_RALT]:
currentTime = pygame.time.get_ticks()
if currentTime - self.lastThrowTime >= self.throwDelay:
self.currentLevel.throw_projectile()
@@ -119,7 +121,7 @@ class WickedQuest:
play_sound(self.sounds[player.currentWeapon.attackSound])
# Handle jumping
if keys[pygame.K_w] and not player.isJumping:
if (keys[pygame.K_w] or keys[pygame.K_UP]) and not player.isJumping:
player.isJumping = True
player.jumpStartTime = currentTime
play_sound(self.sounds['jump'])