-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArea.js
29 lines (24 loc) · 987 Bytes
/
Area.js
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
function Area(index) {
powerupjs.GameObjectList.call(this, ID.layer_objects);
this.index = index
this.add(new TileField(index))
this.add(new BoundaryFeild(index))
var objectFeild = new ObjectFeild(index);
this.player = new Player(this.index)
this.player.playAnimation('idle_front')
objectFeild.add(this.player)
objectFeild.add(new Slime(index, 'green', new powerupjs.Vector2(350, 350)))
this.add(objectFeild)
this.terrainEditor = new TerrainEditor(index)
this.add(this.terrainEditor)
this.add(new FrontTileField(index))
this.add(new BoundaryEditor(index))
this.add(new NatureDecoEditor(index))
this.add(new FlowerEditor(index))
this.add(new WallEditor(index))
}
Area.prototype = Object.create(powerupjs.GameObjectList.prototype)
Area.prototype.update = function(delta) {
powerupjs.GameObjectList.prototype.update.call(this, delta);
this.player.position = powerupjs.Game.gameWorld.map.playerPosition // Have a local position saved everywhere
}