From 80a6e31a4a366f47a0b6c5c453da4a88822dcbb8 Mon Sep 17 00:00:00 2001
From: Quentin LECOMTE <quentin.lecomte@ensiie.fr>
Date: Mon, 3 May 2021 16:20:46 +0200
Subject: [PATCH] Replace boucle_de_jeu.pde

---
 build/boucle_de_jeu/boucle_de_jeu.pde | 31 +++++++++++++++------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/build/boucle_de_jeu/boucle_de_jeu.pde b/build/boucle_de_jeu/boucle_de_jeu.pde
index 4674e50..a144a85 100644
--- a/build/boucle_de_jeu/boucle_de_jeu.pde
+++ b/build/boucle_de_jeu/boucle_de_jeu.pde
@@ -96,7 +96,7 @@ void setup() {
   
   //sons
   bgMusic = new SoundFile(this, "bgmusic.wav");
-  battle = new SoundFile(this, "battle.mp3");
+  battle = new SoundFile(this, "battle.wav");
   droite1 = new SoundFile(this, "droite1.wav");
   droite2 = new SoundFile(this, "droite2.wav");
   droite3 = new SoundFile(this, "droite3.wav");
@@ -109,15 +109,15 @@ void setup() {
   epee1 = new SoundFile(this, "sching.wav");
   epee2 = new SoundFile(this, "schyang.wav");
   epee3 = new SoundFile(this, "sling.wav");
-  woosh = new SoundFile(this, "woosh.mp3");
-  clang1 = new SoundFile(this, "bangbang.mp3");
-  clang2 = new SoundFile(this, "pafpaf.mp3");
-  clang3 = new SoundFile(this, "bonk.mp3");
+  woosh = new SoundFile(this, "woosh.wav");
+  clang1 = new SoundFile(this, "bangbang.wav");
+  clang2 = new SoundFile(this, "pafpaf.wav");
+  clang3 = new SoundFile(this, "bonk.wav");
   aie = new SoundFile(this, "aie.wav");
   mort = new SoundFile(this, "mort.wav");
-  cri1 = new SoundFile(this, "cri.mp3");
+  cri1 = new SoundFile(this, "cri.wav");
   cri2 = new SoundFile(this, "rale.wav");
-  gameover = new SoundFile(this, "gameover.mp3");
+  gameover = new SoundFile(this, "gameover.wav");
   instructions = new SoundFile(this, "instructions.wav");
   
   textFont(createFont("SansSerif", 30 * displayDensity));
@@ -150,7 +150,7 @@ void slash(float a,float b,float c,float d,color col,float offset,float lastcomp
  }
 
 void fade(int n){
-      pg  = createGraphics(displayWidth,displayHeight);
+      pg = createGraphics(displayWidth,displayHeight);
       pg.beginDraw();
       pg.background(0,0,0,n);
       pg.endDraw();
@@ -174,12 +174,15 @@ void draw() {
       text("Instructions", startX+startSizeX/50, startY+startSizeY/3, startSizeX, startSizeY);
       break;
     case 1 : //Correspond au jeu en lui-même
-      if (bgMusic.isPlaying()){
-        bgMusic.stop();
-      }
-      if (!battle.isPlaying()){
-        battle.play();
-      }
+    
+       if (bgMusic.isPlaying() || instructions.isPlaying()){
+         instructions.stop();
+         bgMusic.stop();
+       }
+       if (!battle.isPlaying()){
+         battle.play();
+       }
+      
        if (vie == 3){
         image(troiscoeur, 0, 0, displayWidth, troiscoeur.height * (displayWidth/troiscoeur.width));
       }
-- 
GitLab