Got end of level working. Added floating coffins, shatter them and collect what comes out.
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user