summaryrefslogtreecommitdiff
path: root/game/states/play.js
diff options
context:
space:
mode:
authorJustin Worthe <justin.worthe@entelect.co.za>2014-05-14 12:18:39 +0200
committerJustin Worthe <justin.worthe@entelect.co.za>2014-05-14 12:18:39 +0200
commit98e5b9470fdc102765a289078b3967e3d94fcae0 (patch)
treecd5436269ce5a40486b0b4fc039f62cb49959dcb /game/states/play.js
parenta5ab29fd2d015f2db65d8062d2bb23222859b6d1 (diff)
Added pill to the world and set object anchors to their center
re #4
Diffstat (limited to 'game/states/play.js')
-rw-r--r--game/states/play.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/game/states/play.js b/game/states/play.js
index c52b498..2d73701 100644
--- a/game/states/play.js
+++ b/game/states/play.js
@@ -2,6 +2,7 @@
var Wall = require('../prefabs/wall');
var Player = require('../prefabs/player');
+var Pill = require('../prefabs/pill');
function Play() {}
@@ -32,7 +33,12 @@ Play.prototype = {
},
create: function() {
this.createWalls();
+ this.createPills();
+
this.world.scale = {x:100, y:100};
+ this.world.bounds = {x: -50, y:-50, width: this.game.width, height: this.game.height};
+ this.world.camera.setBoundsToWorld();
+
this.playerA = new Player(this.game, 1, 2, 'player-a', 0);
this.game.add.existing(this.playerA);
this.addPlayerControls();
@@ -80,6 +86,11 @@ Play.prototype = {
this.addToMap(wall.x, wall.y);
}, this);
},
+ createPills: function() {
+ this.pills = this.game.add.group();
+
+ this.pills.add(new Pill(this.game, 1,1));
+ },
addPlayerControls: function() {
var controls = {
up: Phaser.Keyboard.UP,