Code cleanup, added more functionality. Floating coffins that spawn items, graves can spawn zombies, etc.
This commit is contained in:
		| @@ -45,6 +45,12 @@ class WickedQuest: | ||||
|             player.xPos += currentSpeed | ||||
|             player.facingRight = True | ||||
|          | ||||
|         if keys[pygame.K_h]: | ||||
|             speak(f"{player.get_health()} HP") | ||||
|              | ||||
|         if keys[pygame.K_f]:  # Throw projectile | ||||
|             self.currentLevel.throw_projectile() | ||||
|  | ||||
|         # Handle attack with either CTRL key | ||||
|         if (keys[pygame.K_LCTRL] or keys[pygame.K_RCTRL]) and player.start_attack(currentTime): | ||||
|             self.sounds[player.currentWeapon.attackSound].play() | ||||
| @@ -77,6 +83,9 @@ class WickedQuest: | ||||
|             if check_for_exit(): | ||||
|                 return | ||||
|                  | ||||
|             # Update player state (including power-ups) | ||||
|             self.currentLevel.player.update(currentTime) | ||||
|                  | ||||
|             self.handle_input() | ||||
|              | ||||
|             # Update audio positioning and handle collisions | ||||
| @@ -86,6 +95,9 @@ class WickedQuest: | ||||
|             # Handle combat interactions | ||||
|             self.currentLevel.handle_combat(currentTime) | ||||
|              | ||||
|             # Update projectiles | ||||
|             self.currentLevel.handle_projectiles(currentTime) | ||||
|              | ||||
|             clock.tick(60)  # 60 FPS | ||||
|              | ||||
|         # Player died or ran out of lives | ||||
|   | ||||
		Reference in New Issue
	
	Block a user