-
Notifications
You must be signed in to change notification settings - Fork 0
/
Menu.agc
62 lines (48 loc) · 1.16 KB
/
Menu.agc
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
MenuJogo:
// Título do jogo
titulo = CreateText("Breakout!")
SetTextSize(titulo, 100)
SetTextPosition(titulo, (1280-GetTextTotalWidth(titulo))/2, 50)
// Jogar / Play
instrucao = CreateText("Clique com o mouse em qualquer canto da tela para jogar!")
SetTextSize(instrucao, 50)
SetTextPosition(instrucao, (1280-GetTextTotalWidth(instrucao))/2, 360)
Gosub EsconderSprites
Gosub MostrarMenu
if pontuacaoMaisAlta = 660 or contadorColisao = 31
SetTextVisible(instrucao, 0)
endif
repeat
sync()
until GetPointerPressed() = 1
gameOver = 0
gosub MostrarSprites
gosub EsconderMenu
Return
EsconderSprites:
for i = 1 to 35
SetSpriteVisible(i, 0)
next i
Return
MostrarSprites:
for i = 1 to 35
SetSpriteVisible(i, 1)
next i
SetSpritePhysicsRestitution(2, 100.0)
SetSpritePosition(2, 512, 600)
Return
EsconderMenu:
SetTextVisible(titulo, 0)
SetTextVisible(instrucao, 0)
StopMusic()
music1 = LoadMusic("cant-stop-coming.mp3")
PlayMusic(music1)
SetMusicFileVolume(music1, 15)
Return
MostrarMenu:
SetTextVisible(titulo, 1)
SetTextVisible(instrucao, 1)
music2 = LoadMusic("menu.mp3")
SetMusicFileVolume(music2, 15)
PlayMusic(music2)
Return