New items added..

This commit is contained in:
Storm Dragon
2025-02-06 02:31:57 -05:00
parent c29bcd40b7
commit 8f57069c98
13 changed files with 178 additions and 133 deletions

View File

@@ -79,7 +79,8 @@ class Level:
xPos[0],
obj["y"],
self.sounds,
self # Pass level reference
self, # Pass level reference
item=obj.get("item", "random") # Get item type or default to random
)
self.objects.append(coffin)
# Check if this is an enemy
@@ -221,7 +222,7 @@ class Level:
if obj.hit(self.player.xPos):
self.bouncing_items.append(obj.dropped_item)
speak(f"{obj.dropped_item.item_type} falls out!")
#speak(f"{obj.dropped_item.soundName} falls out!")
def handle_collisions(self):
"""Handle all collision checks and return True if level is complete."""
@@ -265,7 +266,6 @@ class Level:
if self.player._coins % 100 == 0:
# Extra life
speak("Extra life")
self.player._coins = 0
self.player._lives += 1
play_sound(self.sounds['extra_life'])
@@ -273,7 +273,7 @@ class Level:
elif obj.isHazard and not self.player.isJumping:
if not self.player.isInvincible:
play_sound(self.sounds[obj.soundName])
speak("You fell in an open grave!")
speak("You fell in an open grave! Now, it's yours!")
self.player.set_health(0)
return False
else: