Got end of level working. Added floating coffins, shatter them and collect what comes out.

This commit is contained in:
Storm Dragon
2025-02-01 19:50:13 -05:00
parent 6fda41f57b
commit 0a7052094d
8 changed files with 124 additions and 74 deletions

View File

@@ -20,7 +20,15 @@ class CoffinObject(Object):
if not self.is_broken:
self.is_broken = True
self.sounds['coffin_shatter'].play()
# Stop the ongoing coffin sound
if self.channel:
obj_stop(self.channel)
self.channel = None
# Mark coffin as inactive since it's broken
self.isActive = False
# Randomly choose item type
item_type = random.choice(['hand_of_glory', 'jack_o_lantern'])
@@ -28,7 +36,7 @@ class CoffinObject(Object):
direction = random.choice([-1, 1])
drop_distance = random.randint(1, 2)
drop_x = self.xPos + (direction * drop_distance)
self.dropped_item = PowerUp(
drop_x,
self.yPos,