mirror of
https://github.com/n0remac/game-jam-2020.git
synced 2025-12-09 18:05:18 -06:00
Added monster damage.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user