Fix sunflowers and merchants since the position of the player is no longer fixed
This commit is contained in:
		@@ -473,7 +473,7 @@ class TestGame(unittest.TestCase):
 | 
				
			|||||||
        self.game.state = GameMode.PLAY
 | 
					        self.game.state = GameMode.PLAY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        sunflower = Sunflower()
 | 
					        sunflower = Sunflower()
 | 
				
			||||||
        sunflower.move(2, 6)
 | 
					        sunflower.move(self.game.player.y + 1, self.game.player.x)
 | 
				
			||||||
        self.game.map.add_entity(sunflower)
 | 
					        self.game.map.add_entity(sunflower)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Does nothing
 | 
					        # Does nothing
 | 
				
			||||||
@@ -504,15 +504,15 @@ class TestGame(unittest.TestCase):
 | 
				
			|||||||
                      Sunflower.dialogue_option)
 | 
					                      Sunflower.dialogue_option)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Test all directions to detect the friendly entity
 | 
					        # 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.CHAT)
 | 
				
			||||||
        self.game.handle_key_pressed(KeyValues.UP)
 | 
					        self.game.handle_key_pressed(KeyValues.UP)
 | 
				
			||||||
        self.assertEqual(len(self.game.logs.messages), 3)
 | 
					        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.CHAT)
 | 
				
			||||||
        self.game.handle_key_pressed(KeyValues.LEFT)
 | 
					        self.game.handle_key_pressed(KeyValues.LEFT)
 | 
				
			||||||
        self.assertEqual(len(self.game.logs.messages), 4)
 | 
					        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.CHAT)
 | 
				
			||||||
        self.game.handle_key_pressed(KeyValues.RIGHT)
 | 
					        self.game.handle_key_pressed(KeyValues.RIGHT)
 | 
				
			||||||
        self.assertEqual(len(self.game.logs.messages), 5)
 | 
					        self.assertEqual(len(self.game.logs.messages), 5)
 | 
				
			||||||
@@ -524,7 +524,7 @@ class TestGame(unittest.TestCase):
 | 
				
			|||||||
        self.game.state = GameMode.PLAY
 | 
					        self.game.state = GameMode.PLAY
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        merchant = Merchant()
 | 
					        merchant = Merchant()
 | 
				
			||||||
        merchant.move(2, 6)
 | 
					        merchant.move(self.game.player.y + 1, self.game.player.x)
 | 
				
			||||||
        self.game.map.add_entity(merchant)
 | 
					        self.game.map.add_entity(merchant)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Does nothing
 | 
					        # Does nothing
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user