diff options
author | Justin Worthe <justin.worthe@gmail.com> | 2014-04-21 12:08:55 +0200 |
---|---|---|
committer | Justin Worthe <justin.worthe@gmail.com> | 2014-04-21 12:08:55 +0200 |
commit | 8de58b344fdb824e47c1d733d470e9e9cecf74f9 (patch) | |
tree | 7692c1f13135b2e40412e3645a8120e21467db3a /game/states/play.js | |
parent | e63dfa8396f37f107ba4b910f555ef5fdf4a9ac7 (diff) |
Added wall sprites and hard coded a very basic map
closes #2
Diffstat (limited to 'game/states/play.js')
-rw-r--r-- | game/states/play.js | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/game/states/play.js b/game/states/play.js index 1e9e3e1..ef55d1f 100644 --- a/game/states/play.js +++ b/game/states/play.js @@ -1,14 +1,54 @@ 'use strict'; +var Wall = require('../prefabs/wall'); + function Play() {} Play.prototype = { preload: function() { }, create: function() { + this.createWalls(); +// this.world.scale = {x:0.5, y:0.5}; }, 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)); + this.walls.add(new Wall(this.game, 300,0)); + this.walls.add(new Wall(this.game, 400,0)); + this.walls.add(new Wall(this.game, 500,0)); + this.walls.add(new Wall(this.game, 600,0)); + this.walls.add(new Wall(this.game, 700,0)); + + this.walls.add(new Wall(this.game, 0,100)); + this.walls.add(new Wall(this.game, 700,100)); + + this.walls.add(new Wall(this.game, 0,200)); + this.walls.add(new Wall(this.game, 200,200)); + this.walls.add(new Wall(this.game, 500,200)); + this.walls.add(new Wall(this.game, 700,200)); + + this.walls.add(new Wall(this.game, 0,300)); + this.walls.add(new Wall(this.game, 200,300)); + this.walls.add(new Wall(this.game, 500,300)); + this.walls.add(new Wall(this.game, 700,300)); + + this.walls.add(new Wall(this.game, 0,400)); + this.walls.add(new Wall(this.game, 700,400)); + + this.walls.add(new Wall(this.game, 0,500)); + this.walls.add(new Wall(this.game, 100,500)); + this.walls.add(new Wall(this.game, 200,500)); + this.walls.add(new Wall(this.game, 300,500)); + this.walls.add(new Wall(this.game, 400,500)); + this.walls.add(new Wall(this.game, 500,500)); + this.walls.add(new Wall(this.game, 600,500)); + this.walls.add(new Wall(this.game, 700,500)); } -}; +}; module.exports = Play; |