From e14e154b7184ff6448f2c71e461f55e49a86d4da Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Wed, 11 Jun 2014 10:08:43 -0700 Subject: [PATCH] Changed shadow size to match world --- moonlight/js/moonlight-skulk.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index f400658..1139eb7 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -218,14 +218,14 @@ GameState.prototype.create = function() 20, 20, '', { font: '16px Arial', fill: '#ffffff' } ); - this.shadowTexture = game.add.bitmapData(game.width, game.height); + this.shadowTexture = game.add.bitmapData(game.world.width, game.world.height); // Create an object that will use the bitmap as a texture - this.lightSprite = game.add.image(0, 0, this.shadowTexture); + this.shadowSprite = game.add.image(0, 0, this.shadowTexture); // Set the blend mode to MULTIPLY. This will darken the colors of // everything below this sprite. - this.lightSprite.blendMode = Phaser.blendModes.MULTIPLY; + this.shadowSprite.blendMode = Phaser.blendModes.MULTIPLY; // Create the lights this.lights = game.add.group(); @@ -329,8 +329,6 @@ GameState.prototype.update = function() this.check_input(); this.physics.arcade.collide(player, layer); - this.lightSprite.x = game.camera.x; - this.lightSprite.y = game.camera.y; this.movingLight.x = player.x; this.movingLight.y = player.y; this.updateShadowTexture();