You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.2 KiB
48 lines
1.2 KiB
import pygame
|
|
from pygame.locals import *
|
|
|
|
class Image():
|
|
def __init__ (self, fenetre, chm_acces, pos_x, pos_y):
|
|
self.fenetre = fenetre
|
|
self.chm_acces = chm_acces
|
|
self.pos_x = pos_x
|
|
self.pos_y = pos_y
|
|
|
|
self.image = pygame.image.load(self.chm_acces).convert_alpha()
|
|
self.fenetre.blit(self.image, (self.pos_x, self.pos_y))
|
|
|
|
def translater (self,axe, sens, vitesse):
|
|
self.axe = axe
|
|
self.sens = sens
|
|
self.vitesse = vitesse
|
|
|
|
if self.axe == "x":
|
|
if sens == "gauche":
|
|
self.pos_x = self.pos_x - self.vitesse
|
|
else:
|
|
self.pos_x = self.pos_x + self.vitesse
|
|
|
|
else:
|
|
if sens == "haut":
|
|
self.pos_y = self.pos_y - self.vitesse
|
|
else:
|
|
self.pos_y = self.pos_y + self.vitesse
|
|
|
|
self.fenetre.blit(self.image, (self.pos_x, self.pos_y))
|
|
|
|
|
|
def maj(self):
|
|
self.fenetre.blit(self.image, (self.pos_x,self.pos_y))
|
|
|
|
def verifier(self):
|
|
pass
|
|
|
|
"""
|
|
class Groupeimage():
|
|
def __init__ (self, fenetre,):
|
|
|
|
|
|
def maj(self):
|
|
|
|
|
|
"""
|
|
|