Overflown/gamedata/objects/base.py

19 lines
482 B
Python

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()
self.game = game
self.sprite = game.sprite_lib["icon.png"]
self.spriteoffset = 0,0
self.depth = 1 # Sa "profondeur", déterminera l'odre d'affichage des objets
def step(self):
pass
def draw(self):
if self.sprite:
self.game.window.blit(self.sprite,self.rect[:2])