Added points system with scoreboard.

This commit is contained in:
Storm Dragon
2025-02-14 21:39:32 -05:00
parent 03b59256b2
commit 1d60c58532
7 changed files with 45 additions and 4 deletions

View File

@@ -226,6 +226,17 @@ class Enemy(Object):
if self.channel:
obj_stop(self.channel)
self.channel = None
# Calculate and award points based on enemy stats
basePoints = self.health * 500
damageModifier = self.damage * 750
rangeModifier = self.attackRange * 250
speedModifier = int(self.movementSpeed * 1000)
totalPoints = max(basePoints + damageModifier + rangeModifier + speedModifier, 1000)
# Award points
self.level.levelScore += totalPoints
# Play death sound if available using positional audio
deathSound = f"{self.enemyType}_dies"
if deathSound in self.sounds: