add cost attribute
This commit is contained in:
parent
7d9dd06d09
commit
4d6de52e8c
@ -4,7 +4,7 @@ import pygame
|
|||||||
|
|
||||||
|
|
||||||
class TerrainTile(pygame.sprite.Sprite):
|
class TerrainTile(pygame.sprite.Sprite):
|
||||||
def __init__(self, x, y, texture, tileSize):
|
def __init__(self, x, y, texture, tileSize, cost):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
terrainTexturesPath = Path("./data/images/terrain").resolve()
|
terrainTexturesPath = Path("./data/images/terrain").resolve()
|
||||||
self.image = pygame.image.load(str(terrainTexturesPath / texture)).convert()
|
self.image = pygame.image.load(str(terrainTexturesPath / texture)).convert()
|
||||||
@ -14,5 +14,5 @@ class TerrainTile(pygame.sprite.Sprite):
|
|||||||
self.y = y
|
self.y = y
|
||||||
self.rect.x = x * tileSize
|
self.rect.x = x * tileSize
|
||||||
self.rect.y = y * tileSize
|
self.rect.y = y * tileSize
|
||||||
|
self.cost = cost
|
||||||
|
|
||||||
# TODO : rozne koszty map tilesów
|
|
||||||
|
Loading…
Reference in New Issue
Block a user