Overflown/gamedata/objects/base.py

19 lines
482 B
Python
Raw Normal View History

2021-06-25 14:42:35 +02:00
import pygame
class BaseObject():
def __init__(self,x,y,game,w=10,h=10):
self.rect = [x,y,w,h]
self.baserect = self.rect.copy()
2021-06-25 16:13:52 +02:00
self.game = game
2021-06-25 14:42:35 +02:00
self.sprite = game.sprite_lib["icon.png"]
self.spriteoffset = 0,0
self.depth = 1 # Sa "profondeur", déterminera l'odre d'affichage des objets
2021-06-25 16:13:52 +02:00
def step(self):
2021-06-25 14:42:35 +02:00
pass
2021-06-25 16:13:52 +02:00
def draw(self):
2021-06-25 14:42:35 +02:00
if self.sprite:
2021-06-25 16:13:52 +02:00
self.game.window.blit(self.sprite,self.rect[:2])
2021-06-25 14:42:35 +02:00