From 4f7f222d76de8b7a0f823e582a38809aa560a5df Mon Sep 17 00:00:00 2001 From: Quentin LECOMTE <quentin.lecomte@ensiie.fr> Date: Mon, 3 May 2021 17:42:42 +0200 Subject: [PATCH] Update boucle_de_jeu.pde --- build/boucle_de_jeu/boucle_de_jeu.pde | 39 +++++++++++---------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/build/boucle_de_jeu/boucle_de_jeu.pde b/build/boucle_de_jeu/boucle_de_jeu.pde index fbb8467..29ccf58 100644 --- a/build/boucle_de_jeu/boucle_de_jeu.pde +++ b/build/boucle_de_jeu/boucle_de_jeu.pde @@ -179,6 +179,14 @@ void draw() { bgMusic.play(); } vie = 3; + score = 0; + max_combo = 0; + combo = 0; + init_cooldown = 3; + cooldown_ennemy = init_cooldown; + init_reaction = 3; + reaction = init_reaction; + ennemy_move = -1; stroke(0); fill(startColor); rect(startX, startY, startSizeX, startSizeY); @@ -374,31 +382,18 @@ void draw() { break; case 2 : //Correspond à la mort du joueur -<<<<<<< HEAD - if (score > highScore){ - highScore = score; - } - if (max_combo > highCombo){ - highCombo = max_combo; - } - leaderBoard[0] = str(highScore); - leaderBoard[1] = str(highCombo); - textFont(font); - fill(245,24,1); - text("Game Over",displayWidth/4.3,displayHeight/2); - fill(255,255,255,100); - rect(startX, startY, startSizeX, startSizeY); - fill(255,255,255,100); - rect(startX-displayWidth/20, startY2, startSizeX+displayWidth/10, startSizeY); - fill(0,0,0,100); - text("Retour menu", startX+startSizeX/20, startY+startSizeY/3, startSizeX, startSizeY); - text("Combo max : " + max_combo + "\nScore : " + score, startX, startY2+startSizeY/6, startSizeX+displayWidth/10, startSizeY); - break; -======= if (!gameoverhasplayed){ gameoverhasplayed = true; gameover.play(); } + if (score > highScore){ + highScore = score; + } + if (max_combo > highCombo){ + highCombo = max_combo; + } + leaderBoard[0] = str(highScore); + leaderBoard[1] = str(highCombo); textFont(font); fill(245,24,1); text("Game Over",displayWidth/4.3,displayHeight/2); @@ -410,8 +405,6 @@ void draw() { text("Retour menu", startX+startSizeX/20, startY+startSizeY/3, startSizeX, startSizeY); text("Combo max : " + max_combo + "\nScore : " + score, startX, startY2+startSizeY/6, startSizeX+displayWidth/10, startSizeY); break; ->>>>>>> 80a6e31a4a366f47a0b6c5c453da4a88822dcbb8 - } } -- GitLab