Skip to content
Extraits de code Groupes Projets
Valider 6ee1ff85 rédigé par Florentin ROLLET's avatar Florentin ROLLET
Parcourir les fichiers

des changements

parent 016a57be
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -53,6 +53,10 @@ PImage menu;
PImage mortImage;
PImage troiscoeur;
PFont font;
String save;
String[] leaderBoard;
int highCombo;
int highScore;
SoundFile instructions ;
......@@ -135,6 +139,11 @@ void setup() {
background(menu);
font = createFont("samurai.ttf", 70);
noFill();
String save = new String();
String[] leaderBoard = loadStrings("save.txt");
highScore = int(leaderBoard[0]);
highCombo = int(leaderBoard[1]);
}
void slash(float a,float b,float c,float d,color col,float offset,float lastcomp, float comp){
stroke(col);
......@@ -162,6 +171,7 @@ 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);
break;
case 1 : //Correspond au jeu en lui-même
if (vie == 3){
......@@ -336,6 +346,12 @@ void draw() {
break;
case 2 : //Correspond à la mort du joueur
if (score > highScore){
highScore = score;
}
if (max_combo > highCombo){
highCombo = max_combo;
}
textFont(font);
fill(245,24,1);
text("Game Over",displayWidth/4.3,displayHeight/2);
......@@ -389,6 +405,10 @@ public void onPause() {
}
}
public void stop(){
saveStrings("save.txt", new String[]{str(highScore), str(highCombo)});
}
class AccelerometerListener implements SensorEventListener {
public void onSensorChanged(SensorEvent event) {
ax = event.values[0];
......
0
0
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter