-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu.java
More file actions
37 lines (29 loc) · 776 Bytes
/
Copy pathMenu.java
File metadata and controls
37 lines (29 loc) · 776 Bytes
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
import greenfoot.*;
public class Menu extends World
{
private GreenfootSound backgroundMusic = new GreenfootSound("soundtrack zombie.mp3");
public Menu()
{
super(700, 700, 1);
Start start1 = new Start();
addObject(start1, 350, 465);
HTP htp1 = new HTP();
addObject(htp1, 350, 565);
backgroundMusic.playLoop();
}
public void started()
{
if (backgroundMusic != null && !backgroundMusic.isPlaying()) {
backgroundMusic.playLoop();
}
}
public void stopped()
{
if (backgroundMusic != null) {
backgroundMusic.stop();
}
}
public void stopMusic() {
if (backgroundMusic != null) backgroundMusic.stop();
}
}