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

Menu

parent 74a5f2e4
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="">
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="29"/>
<application android:icon="@mipmap/ic_launcher" android:label="">
<activity android:name=".MainActivity" android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
component=app
test/data/menu.jpg

284 ko

import processing.sound.*;
int mode = 0;
//int nbrSound;
int startX, startY, startSizeX, startSizeY;
color startColor, startHighlight;
boolean startOver;
PImage img;
SoundFile files[][];
void setup(){
size(displayWidth, displayHeight);
// création de la liste des sons et initialisation de ceux-ci.
/*files = new SoundFile[8][nbrSound];
for(int i = 0; i<8 ; i++){
for(int j = 0; j<3; j++){
String name = "sound" + str(i) + str(j);
files[i][j] = new SoundFile(this, name);
}
}
*/
//Image menu
startColor = color(255);
startHighlight = color(204);
startSizeX = displayWidth * 3 / 4;
startSizeY = displayHeight/8;
startX = displayWidth/2-startSizeX/2;
startY = displayHeight * 3 / 4;
PImage img = new PImage();
img = loadImage("menu.jpg");
img.resize(displayWidth, displayHeight);
background(img);
}
void playSound(int direction){ // direction = 0 => gauche ; puis on tourne dans le sens horaire. 8 directions au total
int i = int(random(0,3));
files[direction][i].play();
}
float timeBetweenTwoEnemies(int enemyCounter){
return 0;
}
void score(int combo){
}
void draw(){
switch(mode){
case 0 : //Correspond au menu de jeu
update(mouseX, mouseY);
if (startOver) {
fill(startHighlight);
} else {
fill(startColor);
}
stroke(0);
rect(startX, startY, startSizeX, startSizeY);
fill(0, 0, 0);
textSize(150);
text("Play", startX+startSizeX/3, startY+startSizeY/4, startSizeX, startSizeY);
break;
case 1 : //Correspond au jeu en lui-même
background(0);
break;
case 2 : //Correspond à la mort du joueur
break;
}
}
void mousePressed() {
if (startOver) {
mode = 1;
}
}
void update(int x, int y) {
if (mouseX >= startX && mouseX <= x+startSizeX &&
mouseY >= startY && mouseY <= y+startSizeY){
startOver = true;
} else {
startOver = false;
}
}
mode=Android
mode.id=processing.mode.android.AndroidMode
Fichier ajouté
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter