-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenu.pde
99 lines (83 loc) · 1.65 KB
/
Menu.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
button play = new button();
button btSound = new button();
button btDisp = new button();
button btDark = new button();
PImage SoundOn;
PImage SoundOFF;
PImage SeeON;
PImage SeeON2;
PImage SeeOFF;
PImage LightON;
PImage LightOFF;
void Menu() {
showGame();
fill(20, 20, 22, 150);
rect(offsetX, offsetY, tetroWidth*10, tetroWidth*20);
fill(244, 78, 66);
textAlign(CENTER, CENTER);
textSize(height/6);
text("TETRIS", width/2, height/3);
fill(244, 78, 66);
textSize(height/50);
text("Lebecque Florian's Creation", 3*width/4, 7.9*height/8);
play.show();
btSound.show();
btDisp.show();
btDark.show();
}
void newGame() {
score = 0;
level=0;
lost = false;
speed=48;
gameSpeed=48;
tetro = tetromino[next];
x=3;
y = -2;
next = floor(random(0, 7));
for (int i = 0; i<10; i++) {
for (int j = 0; j<20; j++) {
GameTable[i][j] = 0;
}
}
ScreenState = 1;
if (is_sound) {
Place.play();
TetrisMusic = new SoundFile(this, "music.wav");
TetrisMusic.loop();
}
}
void btSound_click() {
is_sound = !is_sound;
if (is_sound) {
btSound.texture = SoundOn;
} else {
btSound.texture = SoundOFF;
}
saveSetup();
}
void btDisp_click() {
is_zone +=1;
if (is_zone==1) {
btDisp.texture = SeeON;
}else if(is_zone==2){
btDisp.texture = SeeON2;
}else {
btDisp.texture = SeeOFF;
is_zone=0;
}
saveSetup();
}
void btDark_click() {
is_dark = !is_dark;
if (is_dark) {
btDark.texture = LightOFF;
grid = color(36, 38, 51);
back = color(20, 20, 22);
} else {
btDark.texture = LightON;
grid = color(200,200,220);
back = color(211, 211, 226);
}
saveSetup();
}