From 279d9d9f5819469519e2cb6b3c9b45e3d4857d97 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 10 Nov 2020 23:00:09 +0100 Subject: [PATCH] Monsters can hit the player. No respect for unarmed people... --- dungeonbattle/entities/monsters.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dungeonbattle/entities/monsters.py b/dungeonbattle/entities/monsters.py index 67063da..61a6ebf 100644 --- a/dungeonbattle/entities/monsters.py +++ b/dungeonbattle/entities/monsters.py @@ -30,6 +30,8 @@ class Monster(FightingEntity): self.move_right() else: self.move_left() + if self.distance_squared(target) <= 1: + self.hit(target) else: for _ in range(100): if choice([self.move_up, self.move_down,