Validate all level data before starting game. No more getting to level 10 before realizing there's an error in the json syntax. Notify players when the level is locked with a boss level message.

This commit is contained in:
Storm Dragon
2025-02-26 02:40:47 -05:00
parent 1b0a6eba83
commit 6ef69a33e6
3 changed files with 37 additions and 2 deletions

View File

@@ -40,7 +40,10 @@ class Level:
self.player.set_footstep_sound(self.footstepSound)
# Level intro message
levelIntro = f"Level {levelData['level_id']}, {levelData['name']}. {levelData['description']}"
levelIntro = f"Level {levelData['level_id']}, {levelData['name']}. "
if self.isLocked:
levelIntro += "This is a boss level. You must defeat all enemies before you can advance. "
levelIntro += levelData['description']
messagebox(levelIntro)
# Handle level music

View File

@@ -31,7 +31,7 @@ class Weapon:
return cls(
name="witch_broom",
damage=3,
range=2.5,
range=3,
attackSound="player_broom_attack",
hitSound="player_broom_hit",
cooldown=500,