diff options
Diffstat (limited to 'game/states/play.js')
-rw-r--r-- | game/states/play.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/game/states/play.js b/game/states/play.js index ef55d1f..6d542ca 100644 --- a/game/states/play.js +++ b/game/states/play.js @@ -1,6 +1,7 @@ 'use strict'; var Wall = require('../prefabs/wall'); +var Player = require('../prefabs/player'); function Play() {} @@ -10,11 +11,19 @@ Play.prototype = { create: function() { this.createWalls(); // this.world.scale = {x:0.5, y:0.5}; + this.playerA = new Player(this.game, 100, 200, 'player-a', 0, { + up: Phaser.Keyboard.UP, + down: Phaser.Keyboard.DOWN, + left: Phaser.Keyboard.LEFT, + right: Phaser.Keyboard.RIGHT + }); + this.game.add.existing(this.playerA); }, update: function() { }, createWalls: function() { this.walls = this.game.add.group(); + this.walls.add(new Wall(this.game, 0,0)); this.walls.add(new Wall(this.game, 100,0)); this.walls.add(new Wall(this.game, 200,0)); |