-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.agc
More file actions
158 lines (124 loc) · 3.78 KB
/
menu.agc
File metadata and controls
158 lines (124 loc) · 3.78 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
global game_start as integer = 0
global tetris_title as integer = 0
global tetris_option_1 as integer = 0
global tetris_option_2 as integer = 0
global tetris_back as integer = 0
global tetris_sound_name as integer = 0
function place_menu()
ClearGrid()
PlaceRawBlock(1,65535,0,3)
PlaceRawBlock(1,65535,4,3)
PlaceRawBlock(1,13107,8,3)
PlaceRawBlock(5,119,2,9)
PlaceRawBlock(5,119,5,9)
PlaceRawBlock(6,119,2,12)
PlaceRawBlock(6,119,5,12)
tetris_title = CreateText("TETRIS")
SetTextFont(tetris_title,fonts)
SetTextSize(tetris_title,150)
SetTextPosition(tetris_title,20,131)
SetTextColor(tetris_title,255,255,255,255)
tetris_option_1 = CreateText("PLAY")
SetTextFont(tetris_option_1,fonts)
SetTextSize(tetris_option_1,100)
SetTextPosition(tetris_option_1,175,450)
SetTextColor(tetris_option_1,255,255,255,255)
tetris_option_2 = CreateText("MEDIA")
SetTextFont(tetris_option_2,fonts)
SetTextSize(tetris_option_2,100)
SetTextPosition(tetris_option_2,160,632)
SetTextColor(tetris_option_2,0,0,0,255)
tetris_back = CreateText("BACK")
SetTextFont(tetris_back,fonts)
SetTextSize(tetris_back,75)
SetTextPosition(tetris_back,28,1005)
SetTextColor(tetris_back,0,0,0,255)
SetTextVisible(tetris_back,0)
tetris_sound_name = CreateText("techno - tetris (remix)")
SetTextFont(tetris_sound_name,fonts)
SetTextSize(tetris_sound_name,35)
SetTextPosition(tetris_sound_name,45,632)
SetTextColor(tetris_sound_name,255,255,255,255)
SetTextVisible(tetris_sound_name,0)
endfunction
function show_menu()
ClearGrid()
PlaceRawBlock(1,65535,0,3)
PlaceRawBlock(1,65535,4,3)
PlaceRawBlock(1,13107,8,3)
PlaceRawBlock(5,119,2,9)
PlaceRawBlock(5,119,5,9)
PlaceRawBlock(6,119,2,12)
PlaceRawBlock(6,119,5,12)
SetTextVisible(tetris_title,1)
SetTextVisible(tetris_option_1,1)
SetTextVisible(tetris_option_2,1)
SetTextVisible(tetris_back,0)
SetTextVisible(tetris_sound_name,0)
DrawGrid()
endfunction
function check_click()
box_corner_x = 2*bw+xo
box_corner_y = 9*bh+yo
box_w = 6*bw
box_h = 2*bh
mouse_x = GetPointerX()
mouse_y = GetPointerY()
if GetPointerPressed()
if GetTextVisible(tetris_option_1)
if box_corner_x <= mouse_x and box_corner_x+6*bw>=mouse_x
if box_corner_y <= mouse_y and box_corner_y+2*bh>=mouse_y
game_start = 1
SetTextVisible(tetris_title,0)
SetTextVisible(tetris_option_1,0)
SetTextVisible(tetris_option_2,0)
SetTextVisible(tetris_back,0)
SetTextVisible(tetris_sound_name,0)
reset()
elseif box_corner_y+3*bh <= mouse_y and box_corner_y+5*bh>=mouse_y
show_media()
endif
endif
elseif GetTextVisible(tetris_back)
if box_corner_x-2*bw <= mouse_x and box_corner_x+2*bw>=mouse_x
if box_corner_y+9*bh <= mouse_y and box_corner_y+11*bh>=mouse_y
SetSpriteVisible(saber_dance_animation,0)
StopSprite(saber_dance_animation)
SetSpriteVisible(dance_animation,0)
StopSprite(dance_animation)
show_menu()
endif
endif
endif
endif
if GetTextVisible(tetris_back)
if mod(Timer(),4) < 2
if not GetSpriteVisible(dance_animation)
SetSpriteVisible(saber_dance_animation,0)
StopSprite(saber_dance_animation)
SetSpriteVisible(dance_animation,1)
PlaySprite( dance_animation, 25, 1, 1, 12 )
endif
else
if not GetSpriteVisible(saber_dance_animation)
SetSpriteVisible(dance_animation,0)
StopSprite(dance_animation)
SetSpriteVisible(saber_dance_animation,1)
PlaySprite( saber_dance_animation, 25, 1, 1, 12 )
endif
endif
endif
endfunction
function show_media()
ClearGrid()
PlaceRawBlock(7,255,0,18)
for x = 1 to 7
PlaceRawBlock(x,1,x+1,9)
next
SetTextVisible(tetris_title,0)
SetTextVisible(tetris_option_1,0)
SetTextVisible(tetris_option_2,0)
SetTextVisible(tetris_sound_name,1)
SetTextVisible(tetris_back,1)
DrawGrid()
endfunction