-
Notifications
You must be signed in to change notification settings - Fork 0
/
StartScreen.pde
59 lines (54 loc) · 1.31 KB
/
StartScreen.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
class StartScreen
{
// SCREEN-CODE(0)
// FIELDS:
color buttonCostumeColor = color(255);
color buttonPlayColor = color(255);
color buttonInstructionsColor = color(255);
// METHODS:
void render()
{
surface.setTitle("IRON MAN: THE GAME > MAIN MENU");
background(startBackground);
tint(buttonCostumeColor);
image(startButtonCostume, 0, 0);
tint(buttonPlayColor);
image(startButtonPlay, 0, 0);
tint(buttonInstructionsColor);
image(startButtonInstructions, 0, 0);
// HANDLES MOUSE CLICK ACTIONS OF BUTTONS:
if (mouseX >= 97 && mouseX <= 413 && mouseY >= 404 && mouseY <= 683)
{
buttonCostumeColor = color(255, 0, 0);
if (mousePressed)
{
screen = COSTUME;
}
} else
{
buttonCostumeColor = color(255);
}
if (mouseX >= 480 && mouseX <= 796 && mouseY >= 404 && mouseY <= 683)
{
buttonPlayColor = color(255, 0, 0);
if (mousePressed)
{
screen = DEMO;
}
} else
{
buttonPlayColor = color(255);
}
if (mouseX >= 862 && mouseX <= 1177 && mouseY >= 404 && mouseY <= 683)
{
buttonInstructionsColor = color(255, 0, 0);
if (mousePressed)
{
screen = MAIN_INSTRUCTIONS;
}
} else
{
buttonInstructionsColor = color(255);
}
}
} // class end