PinmikPanik/gamedata/objects/base.py

23 lines
694 B
Python
Raw Normal View History

2021-09-10 19:22:30 +02:00
import pygame
class BaseObject():
def __init__(self,x,y,game,w=10,h=10):
self.rect = pygame.Rect([x,y,w,h])
self.baserect = self.rect.copy()
self.game = game
self.sprite = game.sprite_lib["icon.png"]
self.spriteoffset = 0,0
2021-09-19 12:20:43 +02:00
self.handlepause = False
2021-09-10 19:22:30 +02:00
self.depth = 1 # Sa "profondeur", déterminera l'odre d'affichage des objets
def step(self):
pass
2021-09-13 11:33:40 +02:00
def draw(self): # Drawed on the surface with camera adjustement
2021-09-10 19:22:30 +02:00
if self.sprite:
self.game.window.blit(self.sprite,self.rect[:2])
2021-09-13 11:33:40 +02:00
def afterdraw(self): # Drawed on the surface after camera adjustement, must draw on game.realwindow
pass