DSZI_Survival/src/game/TerrainTile.py

14 lines
498 B
Python
Raw Normal View History

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__()
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))
self.rect = self.image.get_rect()