Added points system with scoreboard.
This commit is contained in:
11
src/enemy.py
11
src/enemy.py
@@ -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:
|
||||
|
Reference in New Issue
Block a user