Newer
Older
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
46
47
48
49
50
51
52
53
54
55
56
57
boolean isSettingsClick = false;
boolean isPlayGame = false;
boolean isSettings = false;
boolean isDead = false;
PFont comic;
SettingsJSON settings;
boolean loaded = false;
void draw() {
if (!loaded) {
settings = new SettingsJSON();
settings.loadSettings();
loaded= true;
}
isPlayGame = false;
isSettings = false;
isDead = false;
if (settings.darkMode) {
background(0);
} else {
background(255);
}
rectMode(CENTER);
if (settings.darkMode) {
stroke(255);
fill(0);
}
else{
stroke(0);
fill(255);
}
rect(width / 3, height / 2 + 100, 300, 100);
rect(width - width / 3, height / 2 + 100, 300, 100);
textAlign(CENTER);
comic = createFont("COMIC.TTF", 80);
textFont(comic);
if (settings.darkMode) {
fill(255);
}
else{
fill(0);
}
text("Jouer", width / 3, height / 2 + 125);
comic = createFont("COMIC.TTF", 55);
textFont(comic);
text("Paramètres", width - width / 3, height / 2 + 125);
if (mousePressed) {
if (mouseX < width / 2 && mouseY > height / 2 + 50 && mouseY < height / 2 + 150) {// Bouton Gauche
isPlayGame = true;
}
if (mouseX > width / 2 && mouseY > height / 2 + 50 && mouseY < height / 2 + 150) {// Bouton droit
isSettings = true;
}
}
}