Fix not adding grass tiles to terrainTilesList

This commit is contained in:
Michał Czekański 2020-04-26 18:34:38 +02:00
parent 08d425b938
commit 87fc6bea1f

View File

@ -89,7 +89,7 @@ class Map:
self.terrainTilesList.append(object) self.terrainTilesList.append(object)
elif tile == '.': elif tile == '.':
object = TerrainTile(col, row, 'grass.png', self.tileSize, 10) object = TerrainTile(col, row, 'grass.png', self.tileSize, 10)
self.screen.draw(TerrainTile(col, row, 'grass.png', self.tileSize, 10), Locations.MAP, 0, 0) self.screen.draw(object, Locations.MAP, 0, 0)
self.terrainTilesList.append(object) self.terrainTilesList.append(object)
elif tile == 'c': elif tile == 'c':
object = TerrainTile(col, row, 'clay.png', self.tileSize, 20) object = TerrainTile(col, row, 'clay.png', self.tileSize, 20)
@ -112,7 +112,7 @@ class Map:
return result return result
# W przypadku podania kordynatów playera, powinno zwrócić teren na którym jest player # W przypadku podania kordynatów playera, powinno zwrócić teren na którym jest player
def getTileOnCoord(self, coord): def getTileOnCoord_old(self, coord):
result = None result = None
for tile in self.terrainTilesList: for tile in self.terrainTilesList:
if tile.rect.x == coord[0] and tile.rect.y == coord[1]: if tile.rect.x == coord[0] and tile.rect.y == coord[1]: