From 209bde5b5c23bc6c278e3cb1d4bf49bdf8aa5b1c Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Fri, 11 Dec 2020 19:21:02 +0100 Subject: [PATCH] Fix sunflowers and merchants since the position of the player is no longer fixed --- squirrelbattle/tests/game_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/squirrelbattle/tests/game_test.py b/squirrelbattle/tests/game_test.py index 8203299..b21a753 100644 --- a/squirrelbattle/tests/game_test.py +++ b/squirrelbattle/tests/game_test.py @@ -473,7 +473,7 @@ class TestGame(unittest.TestCase): self.game.state = GameMode.PLAY sunflower = Sunflower() - sunflower.move(2, 6) + sunflower.move(self.game.player.y + 1, self.game.player.x) self.game.map.add_entity(sunflower) # Does nothing @@ -504,15 +504,15 @@ class TestGame(unittest.TestCase): Sunflower.dialogue_option) # Test all directions to detect the friendly entity - self.game.player.move(3, 6) + self.game.player.move(sunflower.y + 1, sunflower.x) self.game.handle_key_pressed(KeyValues.CHAT) self.game.handle_key_pressed(KeyValues.UP) self.assertEqual(len(self.game.logs.messages), 3) - self.game.player.move(2, 7) + self.game.player.move(sunflower.y, sunflower.x + 1) self.game.handle_key_pressed(KeyValues.CHAT) self.game.handle_key_pressed(KeyValues.LEFT) self.assertEqual(len(self.game.logs.messages), 4) - self.game.player.move(2, 5) + self.game.player.move(sunflower.y, sunflower.x - 1) self.game.handle_key_pressed(KeyValues.CHAT) self.game.handle_key_pressed(KeyValues.RIGHT) self.assertEqual(len(self.game.logs.messages), 5) @@ -524,7 +524,7 @@ class TestGame(unittest.TestCase): self.game.state = GameMode.PLAY merchant = Merchant() - merchant.move(2, 6) + merchant.move(self.game.player.y + 1, self.game.player.x) self.game.map.add_entity(merchant) # Does nothing