diff --git a/build/boucle_de_jeu/boucle_de_jeu.pde b/build/boucle_de_jeu/boucle_de_jeu.pde index 9a173b7d48e1ebb8f4700ce4b7440b10a542e619..8b197e0c9b65910e4a8acfe95f6f02523d0b5233 100644 --- a/build/boucle_de_jeu/boucle_de_jeu.pde +++ b/build/boucle_de_jeu/boucle_de_jeu.pde @@ -3,6 +3,7 @@ import android.hardware.Sensor; import android.hardware.SensorManager; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; +import android.os.Environment; import processing.sound.*; PGraphics pg; @@ -53,15 +54,16 @@ PImage menu; PImage mortImage; PImage troiscoeur, deuxcoeur, uncoeur; PFont font; -String save; -String[] leaderBoard; +String[] leaderBoard = new String[2]; int highCombo; int highScore; +File save; SoundFile instructions ; void setup() { + //capteurs context = getActivity(); manager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE); @@ -142,10 +144,11 @@ void setup() { font = createFont("samurai.ttf", 70); noFill(); - String save = new String(); - String[] leaderBoard = loadStrings("save.txt"); + leaderBoard = loadStrings("save.txt") == null ? new String[]{"0","0"} : loadStrings("save.txt") ; + highScore = int(leaderBoard[0]); highCombo = int(leaderBoard[1]); + println(leaderBoard[0]); } void slash(float a,float b,float c,float d,color col,float offset,float lastcomp, float comp){ stroke(col); @@ -153,7 +156,9 @@ void slash(float a,float b,float c,float d,color col,float offset,float lastcomp if (comp < PI/2){strokeWeight(comp*5);} if (comp > PI/2) {strokeWeight(PI/2*5 - (comp%(PI/2))*5);} - } +} + + void fade(int n){ pg = createGraphics(displayWidth,displayHeight); @@ -163,6 +168,7 @@ void fade(int n){ image(pg,0,0); } void draw() { + switch(mode){ case 0 : //Correspond au menu de jeu vie = 3; @@ -174,7 +180,8 @@ void draw() { textFont(font); text("Play", startX+startSizeX/3, startY2+startSizeY/3, startSizeX, startSizeY); text("Instructions", startX+startSizeX/50, startY+startSizeY/3, startSizeX, startSizeY); - text("Highscore : " + highScore,0,0); + text("Highscore : " + highScore,displayWidth/9,displayHeight/10); + text("Highcombo : " + highCombo,displayWidth/9,displayHeight/20); break; case 1 : //Correspond au jeu en lui-même if (vie == 3){ @@ -355,6 +362,8 @@ void draw() { 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,7 +419,7 @@ public void onPause() { } public void stop(){ - saveStrings("save.txt", new String[]{str(highScore), str(highCombo)}); + saveStrings("data.txt", leaderBoard); } class AccelerometerListener implements SensorEventListener { diff --git a/build/boucle_de_jeu/save.txt b/build/boucle_de_jeu/save.txt deleted file mode 100644 index 9aea9e0ce5f29b6de4471bfcb57af3538d4a669e..0000000000000000000000000000000000000000 --- a/build/boucle_de_jeu/save.txt +++ /dev/null @@ -1,2 +0,0 @@ -0 -0 \ No newline at end of file diff --git a/build/data/.gitkeep b/build/data/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/build/data/aie.wav b/build/data/aie.wav deleted file mode 100644 index 8c315a1ac3dee31a91173f2bebe51a458178e917..0000000000000000000000000000000000000000 Binary files a/build/data/aie.wav and /dev/null differ diff --git a/build/data/bangbang.mp3 b/build/data/bangbang.mp3 deleted file mode 100644 index a517c1d324d71619b844b44ab28e2a9077b9d0dd..0000000000000000000000000000000000000000 Binary files a/build/data/bangbang.mp3 and /dev/null differ diff --git a/build/data/bgmusic.wav b/build/data/bgmusic.wav deleted file mode 100644 index f6525625cabe3e4ca72664f4e25db5f798f35b27..0000000000000000000000000000000000000000 Binary files a/build/data/bgmusic.wav and /dev/null differ diff --git a/build/data/bonk.mp3 b/build/data/bonk.mp3 deleted file mode 100644 index e40de65fe9450a11963c3f98994e629a06d6ddd9..0000000000000000000000000000000000000000 Binary files a/build/data/bonk.mp3 and /dev/null differ diff --git a/build/data/coeurplein.png b/build/data/coeurplein.png deleted file mode 100644 index f3d013951e92a41857d4bb38e4bd8a5b8de29e5d..0000000000000000000000000000000000000000 Binary files a/build/data/coeurplein.png and /dev/null differ diff --git a/build/data/coeurvide.png b/build/data/coeurvide.png deleted file mode 100644 index 41abd72a4e31587f0bdb9239a85b14ca351b4d49..0000000000000000000000000000000000000000 Binary files a/build/data/coeurvide.png and /dev/null differ diff --git a/build/data/cri.mp3 b/build/data/cri.mp3 deleted file mode 100644 index 0e8e8b7d2bc336b2802951976953e270c1961c81..0000000000000000000000000000000000000000 Binary files a/build/data/cri.mp3 and /dev/null differ diff --git a/build/data/droite1.wav b/build/data/droite1.wav deleted file mode 100644 index 9f5306c5525df0941e397307a851b03a3d8f27e8..0000000000000000000000000000000000000000 Binary files a/build/data/droite1.wav and /dev/null differ diff --git a/build/data/droite2.wav b/build/data/droite2.wav deleted file mode 100644 index 3937afa990f66eccaf2ec2d2165cf6f0d597a200..0000000000000000000000000000000000000000 Binary files a/build/data/droite2.wav and /dev/null differ diff --git a/build/data/droite3.wav b/build/data/droite3.wav deleted file mode 100644 index f559cef8c768393d27fa561d84c219b2f795f5c4..0000000000000000000000000000000000000000 Binary files a/build/data/droite3.wav and /dev/null differ diff --git a/build/data/gauche1.wav b/build/data/gauche1.wav deleted file mode 100644 index 1a616617b95cf52e34372bd067ca42256dec07e5..0000000000000000000000000000000000000000 Binary files a/build/data/gauche1.wav and /dev/null differ diff --git a/build/data/gauche2.wav b/build/data/gauche2.wav deleted file mode 100644 index 64b4609848b1d193d381370d40fa2d9b35829ece..0000000000000000000000000000000000000000 Binary files a/build/data/gauche2.wav and /dev/null differ diff --git a/build/data/gauche3.wav b/build/data/gauche3.wav deleted file mode 100644 index 687246d42c75c925ec803c423f49ad8d1ece8f60..0000000000000000000000000000000000000000 Binary files a/build/data/gauche3.wav and /dev/null differ diff --git a/build/data/menu.jpg b/build/data/menu.jpg deleted file mode 100644 index ad451632d4f5c674f5dffa6c81faca3fd9314675..0000000000000000000000000000000000000000 Binary files a/build/data/menu.jpg and /dev/null differ diff --git a/build/data/mort.png b/build/data/mort.png deleted file mode 100644 index 96f1b2cbec5eda93fd1e5a560aed357673659f07..0000000000000000000000000000000000000000 Binary files a/build/data/mort.png and /dev/null differ diff --git a/build/data/mort.wav b/build/data/mort.wav deleted file mode 100644 index 7db1b5291661bbfc17b2cdff9b3ba8a3afe155f6..0000000000000000000000000000000000000000 Binary files a/build/data/mort.wav and /dev/null differ diff --git a/build/data/neutre1.wav b/build/data/neutre1.wav deleted file mode 100644 index bfa597f8029b2fb799f8f2b6c486d66530f86930..0000000000000000000000000000000000000000 Binary files a/build/data/neutre1.wav and /dev/null differ diff --git a/build/data/neutre2.wav b/build/data/neutre2.wav deleted file mode 100644 index de34d85dc321bc291e43a0b75876dedb739195b8..0000000000000000000000000000000000000000 Binary files a/build/data/neutre2.wav and /dev/null differ diff --git a/build/data/neutre3.wav b/build/data/neutre3.wav deleted file mode 100644 index e5f4f71796892b42cb0636430ae76d8bcad00de7..0000000000000000000000000000000000000000 Binary files a/build/data/neutre3.wav and /dev/null differ diff --git a/build/data/pafpaf.mp3 b/build/data/pafpaf.mp3 deleted file mode 100644 index 6af0dc2cfe31e7cd50c6befd003a4e137dfa970a..0000000000000000000000000000000000000000 Binary files a/build/data/pafpaf.mp3 and /dev/null differ diff --git a/build/data/rale.wav b/build/data/rale.wav deleted file mode 100644 index c143ed54cb75ed10ed3c9627e9d910dd264762c6..0000000000000000000000000000000000000000 Binary files a/build/data/rale.wav and /dev/null differ diff --git a/build/data/samurai.ttf b/build/data/samurai.ttf deleted file mode 100644 index 5de690cdd3e8c245e69fe4411e29eacfd5450fc7..0000000000000000000000000000000000000000 Binary files a/build/data/samurai.ttf and /dev/null differ diff --git a/build/data/sching.wav b/build/data/sching.wav deleted file mode 100644 index 00f86082335bd3d36a772f2d47db119761d216a9..0000000000000000000000000000000000000000 Binary files a/build/data/sching.wav and /dev/null differ diff --git a/build/data/schyang.wav b/build/data/schyang.wav deleted file mode 100644 index fdf14952b19b95c650eb35dc2817ea6309961437..0000000000000000000000000000000000000000 Binary files a/build/data/schyang.wav and /dev/null differ diff --git a/build/data/sling.wav b/build/data/sling.wav deleted file mode 100644 index e10af2b033cda64dd8d51bcfdb5f98f183692903..0000000000000000000000000000000000000000 Binary files a/build/data/sling.wav and /dev/null differ diff --git a/build/data/woosh.mp3 b/build/data/woosh.mp3 deleted file mode 100644 index e3ced856f080fc94c579287d9441c5044ed7903f..0000000000000000000000000000000000000000 Binary files a/build/data/woosh.mp3 and /dev/null differ