-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyWorld.java
53 lines (47 loc) · 1.32 KB
/
MyWorld.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
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class MyWorld here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class MyWorld extends World
{
Spielfigur spielfigur;
/**
* Constructor for objects of class MyWorld.
*
*/
public MyWorld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(20, 15, 50);
prepare();
}
public void prepare(){
spielfigur = new Spielfigur();
addObject(spielfigur,10,7);
Mauer mauer = new Mauer();
addObject(mauer,5,5);
Mauer mauer2 = new Mauer();
addObject(mauer2,5,4);
Mauer mauer3 = new Mauer();
addObject(mauer3,5,6);
Mauer mauer4 = new Mauer();
addObject(mauer4,6,4);
Mauer mauer5 = new Mauer();
addObject(mauer5,6,3);
Mauer mauer6 = new Mauer();
addObject(mauer6,5,7);
spielfigur.setLocation(1,9);
Monster monster = new Monster();
addObject(monster,7,6);
monster.setLocation(6,6);
monster.setLocation(6,5);
monster.setLocation(4,8);
monster.setLocation(8,9);
}
public Spielfigur spielfigurGeben(){
return spielfigur;
}
}