Reset invincibility and spider web on start of new level.
This commit is contained in:
@@ -12,7 +12,7 @@ class PowerUp(Object):
|
|||||||
)
|
)
|
||||||
self.sounds = sounds
|
self.sounds = sounds
|
||||||
self.direction = direction
|
self.direction = direction
|
||||||
self.speed = 0.0525 # Base movement speed
|
self.speed = 0.05 # Base movement speed
|
||||||
self.item_type = item_type
|
self.item_type = item_type
|
||||||
self.channel = None
|
self.channel = None
|
||||||
self._currentX = x # Initialize the current x position
|
self._currentX = x # Initialize the current x position
|
||||||
|
@@ -37,6 +37,17 @@ class WickedQuest:
|
|||||||
self.player.isDucking = False
|
self.player.isDucking = False
|
||||||
self.player.xPos = levelData["player_start"]["x"]
|
self.player.xPos = levelData["player_start"]["x"]
|
||||||
self.player.yPos = levelData["player_start"]["y"]
|
self.player.yPos = levelData["player_start"]["y"]
|
||||||
|
self.player.isInvincible = False
|
||||||
|
if hasattr(self.player, '_last_countdown'):
|
||||||
|
del self.player._last_countdown
|
||||||
|
self.player.invincibilityStartTime = 0
|
||||||
|
|
||||||
|
# Clean up spider web effects
|
||||||
|
if hasattr(self.player, 'webPenaltyEndTime'):
|
||||||
|
del self.player.webPenaltyEndTime # Remove the penalty timer
|
||||||
|
self.player.moveSpeed *= 2 # Restore normal speed
|
||||||
|
if self.player.currentWeapon:
|
||||||
|
self.player.currentWeapon.attackDuration *= 0.5 # Restore normal attack speed
|
||||||
|
|
||||||
# Pass existing player to new level
|
# Pass existing player to new level
|
||||||
pygame.event.pump()
|
pygame.event.pump()
|
||||||
|
Reference in New Issue
Block a user