|
|
@ -16,7 +16,7 @@ X1_CADEAU1 = 14 |
|
|
|
Y1_CADEAU1 = 110 |
|
|
|
Y1_CADEAU1 = 110 |
|
|
|
X2_CADEAU1 = 22 |
|
|
|
X2_CADEAU1 = 22 |
|
|
|
Y2_CADEAU1 = 115 |
|
|
|
Y2_CADEAU1 = 115 |
|
|
|
POSITION_PLATEFORME = [1,0,0,0,0,1],[1,1,1,0,1,0] |
|
|
|
POSITION_PLATEFORME = [[1,0,0,0,0,1],[1,1,1,0,1,0]] |
|
|
|
#Déclaration des classes |
|
|
|
#Déclaration des classes |
|
|
|
class Plateforme: |
|
|
|
class Plateforme: |
|
|
|
def __init__(self) -> None: |
|
|
|
def __init__(self) -> None: |
|
|
@ -24,8 +24,8 @@ class Plateforme: |
|
|
|
self.y = 10 |
|
|
|
self.y = 10 |
|
|
|
|
|
|
|
|
|
|
|
def afficher(self) -> None: |
|
|
|
def afficher(self) -> None: |
|
|
|
for colonne in range(6): |
|
|
|
for colonne in range(1): |
|
|
|
for ligne in range (1): |
|
|
|
for ligne in range (6): |
|
|
|
if POSITION_PLATEFORME[colonne][ligne] == 1: |
|
|
|
if POSITION_PLATEFORME[colonne][ligne] == 1: |
|
|
|
self.x = (self.x*(colonne+1)) |
|
|
|
self.x = (self.x*(colonne+1)) |
|
|
|
self.y = (self.y*(ligne+1)) |
|
|
|
self.y = (self.y*(ligne+1)) |
|
|
@ -124,11 +124,12 @@ class Jeu: |
|
|
|
self.tirs = [] # Tableau des tirs |
|
|
|
self.tirs = [] # Tableau des tirs |
|
|
|
self.ennemis = [] # Tableau des ennemis présents |
|
|
|
self.ennemis = [] # Tableau des ennemis présents |
|
|
|
self.explosions = [] # Tableau des explosions |
|
|
|
self.explosions = [] # Tableau des explosions |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Lancement de l'alternance 30x par seconde entre controleur et vue |
|
|
|
# Lancement de l'alternance 30x par seconde entre controleur et vue |
|
|
|
pyxel.run(self.controler, self.afficher, self.comportement) |
|
|
|
pyxel.run(self.controler, self.afficher) |
|
|
|
def comportement(self): |
|
|
|
|
|
|
|
self.perenoel.gravite() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def controler(self): |
|
|
|
def controler(self): |
|
|
|
if pyxel.btn(pyxel.KEY_RIGHT): |
|
|
|
if pyxel.btn(pyxel.KEY_RIGHT): |
|
|
@ -143,7 +144,8 @@ class Jeu: |
|
|
|
self.perenoel.afficher() |
|
|
|
self.perenoel.afficher() |
|
|
|
self.objet.afficher() |
|
|
|
self.objet.afficher() |
|
|
|
self.objet2.afficher() |
|
|
|
self.objet2.afficher() |
|
|
|
self.plateforme.afficher() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
j = Jeu() |
|
|
|
j = Jeu() |