-
Notifications
You must be signed in to change notification settings - Fork 0
/
LoadingScreen.java
54 lines (51 loc) · 1.18 KB
/
LoadingScreen.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
49
50
51
52
53
54
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* The loading screen before the simulation is run
*
* @author Jasper Tu
* @version Oct 2014
*/
public class LoadingScreen extends World
{
private int counter = 0;
private boolean exists = true;
/**
* Constructor for objects of class LoadingScreen.
*
*/
public LoadingScreen()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(960, 640, 1);
}
public void act()
{
if(exists == true)
{
if(counter < 300)
{
counter++;
}
else
{
Greenfoot.setWorld(new ZombieWorld());
exists = false;
}
}
}
// /**
// * Starts playing the theme of the zombie simulation.
// */
// public void started()
// {
// theme.playLoop();
// }
//
// /**
// * Stops playing the theme when the simulation is not running
// */
// public void stopped()
// {
// theme.pause();
// }
}