2020-02-12 13:40:25 -08:00
|
|
|
import pygame
|
2020-02-24 18:20:51 -08:00
|
|
|
from . import assets
|
2020-02-12 13:40:25 -08:00
|
|
|
|
2020-02-12 11:26:41 -08:00
|
|
|
class Sprite:
|
2020-02-12 13:40:25 -08:00
|
|
|
texture = None
|
|
|
|
rect = None
|
2020-02-12 11:26:41 -08:00
|
|
|
|
2020-02-20 21:36:17 -08:00
|
|
|
# def __init__(self, filename):
|
|
|
|
# self.set_texture(filename)
|
|
|
|
|
2020-02-12 11:26:41 -08:00
|
|
|
def set_texture(self, filename):
|
2020-02-12 13:40:25 -08:00
|
|
|
self.texture = assets.get(filename)
|
2020-02-20 18:59:04 -08:00
|
|
|
|
|
|
|
def set_rect(self, rect):
|
|
|
|
self.rect = pygame.Rect(*rect)
|
2020-04-26 23:07:39 -07:00
|
|
|
|
|
|
|
def get_rect(self):
|
|
|
|
return self.rect
|