Overflown/gamedata/objects/base.py

21 lines
525 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):
2021-07-01 13:54:56 +02:00
self.rect = pygame.Rect([x,y,w,h])
2021-06-25 14:42:35 +02:00
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-11-25 13:41:38 +01:00
self.ispaused = True
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