Move to closest player if it is close

This commit is contained in:
Yohann D'ANELLO
2020-11-10 22:59:02 +01:00
parent 12ee436f4d
commit f9f02b6621
3 changed files with 48 additions and 5 deletions

View File

@ -23,6 +23,11 @@ class TestEntities(unittest.TestCase):
self.assertEqual(entity.x, 64)
self.assertIsNone(entity.act(self.map))
other_entity = Entity()
other_entity.move(45, 68)
self.assertEqual(entity.distance_squared(other_entity), 25)
self.assertEqual(entity.distance(other_entity), 5)
def test_fighting_entities(self) -> None:
"""
Test some random stuff with fighting entities.