1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
void setup(){
size(900,600); // taille fenetre
menu();
if (b==1){
size(900,600);
background(0);
}
img1=loadImage("fond4.jpg"); // appelle l'image du fond de jeu
}
void rect(){
fill(255,255,255,0); // couleur transparente rect
rect(350,50,200,70); // rect play
rect(350,148,200,70); // rect Command
rect(350,250,200,70); // rect quit
void casedumenu(){ // véréfions si on survole un des 3 rectangles
if (mouseX > 350 && mouseX < 550 && mouseY > 50 && mouseY < 220){
cursor(ARROW);
if(mousePressed){a=1;}
if(mousePressed){b=1;} // case play
}
if (mouseX > 350 && mouseX < 550 && mouseY > 148 && mouseY < 220){
cursor(ARROW); // affiche une fleche
if(mousePressed){command();} // case command
}
if (mouseX > 350 && mouseX < 550 && mouseY > 250 && mouseY < 320){
cursor(ARROW);
if(mousePressed){exit();} // case de quit
}
else {
cursor(ARROW);
}
} |
Partager