Items can no longer bounc past the end of level. Slight modification to item bounce speed, may need more adjustments.

This commit is contained in:
Storm Dragon
2025-02-11 22:50:26 -05:00
parent 8530993fa9
commit c6adc193a1
4 changed files with 31 additions and 18 deletions

View File

@@ -265,7 +265,7 @@ class Level:
obj.xPos >= attackRange[0] and
obj.xPos <= attackRange[1] and
self.player.isJumping): # Must be jumping to hit floating coffins
if obj.hit(self.player.xPos):
self.bouncing_items.append(obj.dropped_item)
@@ -368,7 +368,8 @@ class Level:
play_sound(self.sounds[f'get_{obj.graveItem}'])
self.player.stats.update_stat('Items collected', 1)
# Create PowerUp to handle the item effect
item = PowerUp(obj.xPos, obj.yPos, obj.graveItem, self.sounds, 1)
item = PowerUp(obj.xPos, obj.yPos, obj.graveItem, self.sounds, 1,
self.leftBoundary, self.rightBoundary)
item.apply_effect(self.player)
# Stop grave's current audio channel
if obj.channel: