2022-04-08 01:34:11 +02:00
|
|
|
from re import X
|
|
|
|
import pygame as pg
|
|
|
|
|
|
|
|
class Tile(pg.sprite.Sprite):
|
|
|
|
def __init__(self, img, x, y, width, height):
|
|
|
|
super().__init__()
|
|
|
|
|
|
|
|
self.x = x
|
|
|
|
self.y = y
|
|
|
|
self.width = width
|
|
|
|
self.height = height
|
|
|
|
|
2022-05-10 01:05:34 +02:00
|
|
|
self.image = pg.Surface([width, height], pg.SRCALPHA, 32)
|
2022-04-08 01:34:11 +02:00
|
|
|
self.image.blit(img, (0,0))
|
|
|
|
|
|
|
|
self.rect = pg.Rect(x, y, width, height)
|