-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapManager.java
More file actions
50 lines (40 loc) · 1.12 KB
/
MapManager.java
File metadata and controls
50 lines (40 loc) · 1.12 KB
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
import greenfoot.*; // import every greefoot function, object and more
/**
* Wrapper for map building and stuff of greenfoot
*/
public class MapManager extends Manager
{
public static World currentMap;
private static int width = 1000;
private static int height = 400;
private static int groundHeight = 35;
public static void insertMap() {
Greenfoot.setWorld(new Map());
}
public static void setMap(World map) {
currentMap = map;
// show end screen
if (GameManager.isGameOver()) {
new End();
return;
}
// show start screen
if (!GameManager.isGameStarted() ) {
new Start();
return;
}
new Fujiyama();
}
public static int getWidth() {
return width;
}
public static int getHeight() {
return height;
}
public static int getGroundHeight() {
return groundHeight;
}
public static void showText(String text, int xCord, int yCord) {
currentMap.showText(text, xCord, yCord);
}
}