Reset invincibility and spider web on start of new level.
This commit is contained in:
@@ -37,6 +37,17 @@ class WickedQuest:
|
||||
self.player.isDucking = False
|
||||
self.player.xPos = levelData["player_start"]["x"]
|
||||
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
|
||||
pygame.event.pump()
|
||||
|
Reference in New Issue
Block a user