2020-04-03 19:36:13 +02:00
|
|
|
import pygame
|
|
|
|
import os
|
|
|
|
from os import path
|
|
|
|
|
|
|
|
|
|
|
|
class TerrainTile(pygame.sprite.Sprite):
|
2020-04-03 23:07:12 +02:00
|
|
|
def __init__(self, texture, tileSize):
|
|
|
|
super().__init__()
|
2020-04-03 19:36:13 +02:00
|
|
|
self.imagesFolder = path.dirname("../data/images/")
|
|
|
|
self.terrainFolder = path.join(self.imagesFolder, 'terrain')
|
|
|
|
self.image = pygame.image.load(os.path.join(self.terrainFolder, texture)).convert()
|
2020-04-03 23:07:12 +02:00
|
|
|
self.image = pygame.transform.scale(self.image, (tileSize, tileSize))
|
2020-04-03 19:36:13 +02:00
|
|
|
self.rect = self.image.get_rect()
|