-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTP.java
More file actions
28 lines (25 loc) · 693 Bytes
/
Copy pathHTP.java
File metadata and controls
28 lines (25 loc) · 693 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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Tombol Start untuk memulai permainan.
*/
public class HTP extends Actor
{
// Deklarasi variabel untuk suara klik tombol (Opsional, tapi lebih baik)
private GreenfootSound clickSound = new GreenfootSound("button.mp3");
public HTP()
{
}
public void act()
{
if (Greenfoot.mouseClicked(this))
{
clickSound.play();
World currentWorld = getWorld();
if (currentWorld instanceof Menu)
{
((Menu) currentWorld).stopMusic();
}
Greenfoot.setWorld(new HowToPlay());
}
}
}