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

@@ -14,19 +14,22 @@ class PowerUp(Object):
self.speed = 0.05 # Base movement speed
self.item_type = item_type
self.channel = None
self._currentX = x # Initialize the current x position
def update(self, current_time):
"""Update item position"""
if not self.isActive:
return False
# Update position
self._currentX += self.direction * self.speed
# Keep bounce sound playing while moving
# Update positional audio
if self.channel is None or not self.channel.get_busy():
self.channel = self.sounds['item_bounce'].play(-1)
self.channel = obj_play(self.sounds, "item_bounce", self.xPos, self._currentX)
else:
self.channel = obj_update(self.channel, self.xPos, self._currentX)
# Check if item has gone too far (20 tiles)
if abs(self._currentX - self.xRange[0]) > 20:
self.isActive = False
@@ -34,7 +37,7 @@ class PowerUp(Object):
self.channel.stop()
self.channel = None
return False
return True
def apply_effect(self, player):