WMICraft/models/tile.py

14 lines
410 B
Python
Raw Normal View History

2022-04-10 20:28:50 +02:00
import pygame
2022-04-11 00:01:57 +02:00
from common.helpers import parse_cord
2022-04-10 20:28:50 +02:00
class Tile(pygame.sprite.Sprite):
def __init__(self, position, image, group, tile_type=' '):
super().__init__(group)
self.image = image
self._layer = 0
2022-04-11 12:00:15 +02:00
position_in_px = (parse_cord(position[0]), parse_cord(position[1]))
2022-04-11 00:01:57 +02:00
self.rect = self.image.get_rect(topleft=position_in_px)
self.tile_type = tile_type