blob: 8acb3af614aacf5879403abd2802359ac50bb7c8 (
plain)
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
|
public class Heros extends Entite{
//Les variables
//Les fonctions
Heros (int rangeeStart, PImage imageStart) { //Cette fonction est le constructeur de la classe Hero, elle attribue à Hero une rangée de départ et une image de départ.
rangee = rangeeStart;
avatar = imageStart;
y = (100+200*rangee)-(avatar.height/2);
}
void afficher () {
image (img, 50, y);
}
void setIsDead (boolean dead) { //Change la valeur de isDead quand la fonction est appelée.
isDead = dead;
}
void mourir(){
if(y>=height){
noLoop();
fill(0);
text("Robofactor est mort. Appuyez sur o.", width/2-75, height/2);
}
}
}
|