-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathGameOver.java
36 lines (31 loc) · 875 Bytes
/
GameOver.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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class GameOver here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class GameOver extends World
{
/**
* Constructor for objects of class GameOver.
*
*/
Hitbox hitbox = new Hitbox();
public GameOver(World restart)
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(733, 430, 1, false);
addObject(hitbox,0,0);
Greenfoot.setSpeed(50);
addObject(new Retry(restart), 365, 395);
}
public void act() {
}
public void moveHitbox() {
MouseInfo mouse = Greenfoot.getMouseInfo();
if (mouse != null) {
hitbox.setLocation(mouse.getX(), mouse.getY());
}
}
}