diff --git a/src/AI/AutomaticMovement.py b/src/AI/AutomaticMovement.py index 6e2d138..604c54a 100644 --- a/src/AI/AutomaticMovement.py +++ b/src/AI/AutomaticMovement.py @@ -158,9 +158,8 @@ class AutomaticMovement: # TODO: Nie znajduje terraina na ktorym stoi player if terrainTile is None: - return 0 - # return terrainTile.cost - return 0 + return 1000 + return terrainTile.cost def priority(self, elem: AStarNode): coordsWithUiOffset = [elem.state[0] + self.leftUiWidth, elem.state[1]] diff --git a/src/game/Map.py b/src/game/Map.py index 0a8e57b..8228ba3 100644 --- a/src/game/Map.py +++ b/src/game/Map.py @@ -119,6 +119,15 @@ class Map: result = tile return result + + def getTileOnCoord(self, coord): + result = None + for tile in self.terrainTilesList: + if tile.rect.collidepoint(coord[0], coord[1]): + result = tile + break + return result + # TODO: REMOVE DONT ADD def addEntity(self, entity, DONTADD=False): self.screen.draw(entity, Locations.MAP, 0, 0)