Some minor cleanup.

This commit is contained in:
Storm Dragon
2025-03-21 20:54:13 -04:00
parent cb69189c8e
commit 87d0764156
16 changed files with 193 additions and 193 deletions

View File

@@ -10,21 +10,21 @@ class Projectile:
self.damage = 5 # All projectiles do same damage for now
self.range = 12 # Maximum travel distance in tiles
self.start_x = start_x
def update(self):
"""Update projectile position and check if it should still exist"""
if not self.isActive:
return False
self.x += self.direction * self.speed
# Check if projectile has gone too far
if abs(self.x - self.start_x) > self.range:
self.isActive = False
return False
return True
def hit_enemy(self, enemy):
"""Handle hitting an enemy"""
enemy.take_damage(self.damage)