Added monster damage.

This commit is contained in:
Cameron Smart
2020-04-26 02:08:25 -07:00
parent ef78606bce
commit b84efd31b4
2 changed files with 4 additions and 1 deletions

View File

@@ -226,7 +226,8 @@ class Game(arcade.Window):
def on_update(self, delta_time):
""" Movement and game logic """
if self.player.health == 0:
self.setup()
if len(self.enemy_list) == 0 and len(self.active_enemies)==0:
self.setup()

View File

@@ -69,6 +69,8 @@ class MobHandler:
for enemy in reversed(self.enemy_list):
distance = self.get_distance(enemy)
enemy.collisions.update()
if distance < 100 :
self.player.health -= 1
if (distance < 300):
enemy.speed = Config.MONSTER_MOVEMENT_SPEED
try: