-
Notifications
You must be signed in to change notification settings - Fork 0
/
PerplexiconInitScript.groovy
36 lines (30 loc) · 1.21 KB
/
PerplexiconInitScript.groovy
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 roguelikeengine.item.*
import roguelikeengine.largeobjects.*;
import roguelikeengine.stat.*;
import roguelikeengine.display.*;
import roguelikeengine.area.*;
import roguelikeengine.controller.*;
import roguelikeengine.*;
import roguelikeengine.display.*;
import perplexicon.*;
class PerplexiconInitScript implements InitScript {
public void init(Perplexicon perplexicon) {
LocalArea area = new LocalArea(10, 10, perplexicon.registry.terrainTypes.get("Stone Floor"), "Area1");
TerrainDefinition t = perplexicon.registry.terrainTypes.get("Stone Wall");
for (int i = 0; i < area.getxDist(); i++) {
area.setTerrain(i, 0, t);
area.setTerrain(i, area.getyDist() - 1, t);
}
for (int i = 0; i < area.getyDist(); i++) {
area.setTerrain(0, i, t);
area.setTerrain(area.getxDist() - 1, i, t);
}
Body body = new Body("Player", new AreaLocation(area, 5, 5),
perplexicon.registry.bodyTypes.get("Human"));
Player player = new Player(body, perplexicon);
area.addEntity(body);
Clock clock = new Clock();
clock.addActor(player);
clock.play();
}
}