Key i added for current level information.
This commit is contained in:
		| @@ -10,16 +10,18 @@ You give an evil grin, oh wait, your a skeleton, your skull is always doing that | |||||||
|  |  | ||||||
| Controls | Controls | ||||||
|  |  | ||||||
| a: move left | For your convenience, there are a couple of bindings for each movement key. They are listed here: | ||||||
| d: move right | a or left arrow: move left | ||||||
| w: jump | d or right arrow: move right | ||||||
| s: duck | w or up arrow: jump | ||||||
|  | s or down arrow: duck | ||||||
| Control: attack | Control: attack | ||||||
| Space: hold to run. | Space: hold to run. | ||||||
| f: throw jack O'lantern | f or alt: throw jack O'lantern | ||||||
| c: check bone dust | c: check bone dust | ||||||
| e: Check currently wielded weapon. | e: Check currently wielded weapon. | ||||||
| h check health | h: check health | ||||||
|  | i: Information for current level. | ||||||
| j: check jack O'lanterns | j: check jack O'lanterns | ||||||
| l: check lives remaining | l: check lives remaining | ||||||
| Alt+PageDown: Master volume decrease | Alt+PageDown: Master volume decrease | ||||||
|   | |||||||
| @@ -66,9 +66,9 @@ class WickedQuest: | |||||||
|         pygame.event.pump() |         pygame.event.pump() | ||||||
|      |      | ||||||
|         # Update running and ducking states |         # 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() |             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.stand() | ||||||
|  |  | ||||||
|         player.isRunning = keys[pygame.K_SPACE] |         player.isRunning = keys[pygame.K_SPACE] | ||||||
| @@ -80,11 +80,11 @@ class WickedQuest: | |||||||
|         movementDistance = 0 |         movementDistance = 0 | ||||||
|      |      | ||||||
|         # Horizontal movement |         # Horizontal movement | ||||||
|         if keys[pygame.K_a]:  # Left |         if keys[pygame.K_a] or keys[pygame.K_LEFT]:  # Left | ||||||
|             movementDistance = currentSpeed |             movementDistance = currentSpeed | ||||||
|             player.xPos -= currentSpeed |             player.xPos -= currentSpeed | ||||||
|             player.facingRight = False |             player.facingRight = False | ||||||
|         elif keys[pygame.K_d]:  # Right |         elif keys[pygame.K_d] or keys[pygame.K_RIGHT]:  # Right | ||||||
|             movementDistance = currentSpeed |             movementDistance = currentSpeed | ||||||
|             player.xPos += currentSpeed |             player.xPos += currentSpeed | ||||||
|             player.facingRight = True |             player.facingRight = True | ||||||
| @@ -102,11 +102,13 @@ class WickedQuest: | |||||||
|             speak(f"{player.get_coins()} gbone dust") |             speak(f"{player.get_coins()} gbone dust") | ||||||
|         if keys[pygame.K_h]: |         if keys[pygame.K_h]: | ||||||
|             speak(f"{player.get_health()} health of {player.get_max_health()}") |             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]: |         if keys[pygame.K_l]: | ||||||
|             speak(f"{player.get_lives()} lives") |             speak(f"{player.get_lives()} lives") | ||||||
|         if keys[pygame.K_j]:  # Check jack o'lanterns |         if keys[pygame.K_j]:  # Check jack o'lanterns | ||||||
|             speak(f"{player.get_jack_o_lanterns()} 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() |             currentTime = pygame.time.get_ticks() | ||||||
|             if currentTime - self.lastThrowTime >= self.throwDelay: |             if currentTime - self.lastThrowTime >= self.throwDelay: | ||||||
|                 self.currentLevel.throw_projectile() |                 self.currentLevel.throw_projectile() | ||||||
| @@ -119,7 +121,7 @@ class WickedQuest: | |||||||
|             play_sound(self.sounds[player.currentWeapon.attackSound]) |             play_sound(self.sounds[player.currentWeapon.attackSound]) | ||||||
|              |              | ||||||
|         # Handle jumping |         # 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.isJumping = True | ||||||
|             player.jumpStartTime = currentTime |             player.jumpStartTime = currentTime | ||||||
|             play_sound(self.sounds['jump']) |             play_sound(self.sounds['jump']) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user