diff options
Diffstat (limited to 'game/states')
-rw-r--r-- | game/states/play.js | 11 | ||||
-rw-r--r-- | game/states/preload.js | 1 |
2 files changed, 12 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, diff --git a/game/states/preload.js b/game/states/preload.js index 7154c8f..906be3f 100644 --- a/game/states/preload.js +++ b/game/states/preload.js @@ -14,6 +14,7 @@ Preload.prototype = { this.load.setPreloadSprite(this.asset); this.load.image('wall', 'assets/images/wall.svg'); this.load.image('player-a', 'assets/images/player-a.svg'); + this.load.image('pill', 'assets/images/pill.svg'); }, create: function() { this.asset.cropEnabled = false; |