From da0c1904b8c6cd2423a97c9287251a45544007a0 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sun, 15 Jun 2014 11:54:14 -0700 Subject: [PATCH] Map work --- moonlight/js/moonlight-skulk.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 6ffde17..627cc94 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -891,13 +891,6 @@ GameState.prototype.create = function() spr.update_new_values(); }, this) - this.effectSprites = game.add.group(); - this.map.createFromObjects('EffectSprites', 5, 'player', 0, true, false, this.effectSprites, EffectSprite); - this.effectSprites.forEach(function(spr) { - spr.update_new_values(); - }, this) - player = this.add.sprite((10 * 32), (17 * 32), 'player'); - player.lightmeter = 0; }; if ( lp['collides'] == true ) { this.map_collision_layers.push(layer); @@ -922,6 +915,14 @@ GameState.prototype.create = function() this.camera.follow(player, Phaser.Camera.FOLLOW_TOPDOWN); controls = game.input.keyboard.createCursorKeys(); + this.effectSprites = game.add.group(); + this.map.createFromObjects('EffectSprites', 5, 'player', 0, true, false, this.effectSprites, EffectSprite); + this.effectSprites.forEach(function(spr) { + spr.update_new_values(); + }, this) + player = this.add.sprite((10 * 32), (17 * 32), 'player'); + player.lightmeter = 0; + this.shadowTexture = game.add.bitmapData(game.world.width, game.world.height); // drop this lower to make the map darker this.shadowTextureColor = 'rgb(60, 60, 60)';