-
Notifications
You must be signed in to change notification settings - Fork 6
/
More.java
48 lines (40 loc) · 1.19 KB
/
More.java
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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class More here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class More extends Button
{
/**
* Act - do whatever the More wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public boolean clicked = false;
GreenfootImage[] start;
public int counter = 0;
public More() {
super("more1.png", "more2.png");
start = importSprites("more", 2);
}
public void act()
{
MouseInfo mouse = Greenfoot.getMouseInfo();
MainMenu world = (MainMenu)getWorld();
if (mouse != null) {
world.moveHitbox();
if (this.intersects(world.hitbox)) {
setImage(hover);
} else {
setImage(idle);
}
if (Greenfoot.mouseClicked(this)) {
clicked = true;
AudioPlayer.play(100, "gravebutton.mp3");
}
}
}
public void update() {
}
}