-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathObjetLaptop.pde
45 lines (41 loc) · 1.49 KB
/
ObjetLaptop.pde
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
44
45
class ObjetLaptop extends Objet {
boolean isOn = false;
ObjetLaptop(PVector pos, PVector taille, float epaisseurEcran, float epaisseurClavier) {
// Ecrant
add(new Partie(
new PVector(0, taille.y + epaisseurClavier, 0).add(pos),
new PVector(epaisseurEcran, taille.y, taille.z)));
// Clavier
add(new Partie(
new PVector(epaisseurEcran, epaisseurClavier, 0).add(pos),
new PVector(taille.x, epaisseurClavier, taille.z)));
}
ObjetLaptop(PVector pos, PVector taille, float epaisseurEcran, float epaisseurClavier, color[] couleur) {
// Ecrant
add(new Partie(
new PVector(0, taille.y + epaisseurClavier, 0).add(pos),
new PVector(epaisseurEcran, taille.y, taille.z),
couleur[0]));
// Clavier
add(new Partie(
new PVector(epaisseurEcran, epaisseurClavier, 0).add(pos),
new PVector(taille.x, epaisseurClavier, taille.z),
couleur[1]));
}
ObjetLaptop(PVector pos, PVector taille, float epaisseurEcran, float epaisseurClavier, PImage[] texture) {
// Ecrant
add(new Partie(
new PVector(0, taille.y + epaisseurClavier, 0).add(pos),
new PVector(epaisseurEcran, taille.y, taille.z),
texture[0],1,1));
// Clavier
add(new Partie(
new PVector(epaisseurEcran, epaisseurClavier, 0).add(pos),
new PVector(taille.x, epaisseurClavier, taille.z),
texture[1],1,1));
}
void switchLight() {
isOn = !isOn;
parties.get(0).setEmissive((isOn) ? color(#202020) : color(0));
}
}