-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnd.java
More file actions
36 lines (30 loc) · 1.07 KB
/
End.java
File metadata and controls
36 lines (30 loc) · 1.07 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
import greenfoot.*; // import every greefoot function, object and more
import java.util.*; // import java utils
public class End extends MapConstructor
{
public End()
{
this.build();
}
public void build() {
Image image = new Image("./images/game_over.png");
MapManager.currentMap.addObject(image, MapManager.getWidth() / 2, 80);
Button startButton = new Button("start");
MapManager.currentMap.addObject(startButton, 500, 330);
int yCord = 200;
ArrayList<String> lastPlayedTimes = GameManager.getLastPlayedTimes();
for (int i = 0; i < lastPlayedTimes.size(); i++) {
String text = "";
if (i == 0) {
text = "Deine Zeit: ";
} else if (i == 1) {
text = "Vorher: ";
} else {
text = "Davor: ";
}
String time = lastPlayedTimes.get(0);
MapManager.showText(text + time, MapManager.getWidth() / 2, yCord);
yCord += 25;
}
}
}