From 4583f32c796421124490b88027227cf4c2564eb6 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Wed, 11 Jun 2014 10:11:34 -0700 Subject: [PATCH] Changed shadow size to overlap camera edges, changed fill size to speed up filling --- moonlight/js/moonlight-skulk.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 1139eb7..7168858 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -218,7 +218,7 @@ GameState.prototype.create = function() 20, 20, '', { font: '16px Arial', fill: '#ffffff' } ); - this.shadowTexture = game.add.bitmapData(game.world.width, game.world.height); + this.shadowTexture = game.add.bitmapData(game.world.width + 100, game.world.height + 100); // Create an object that will use the bitmap as a texture this.shadowSprite = game.add.image(0, 0, this.shadowTexture); @@ -244,7 +244,10 @@ GameState.prototype.updateShadowTexture = function() { // Draw shadow this.shadowTexture.context.fillStyle = 'rgb(100, 100, 100)'; - this.shadowTexture.context.fillRect(0, 0, game.width, game.height); + this.shadowTexture.context.fillRect(game.camera.x - 50, + game.camera.y - 50, + game.width + 50, + game.height + 50); // Iterate through each of the lights and draw the glow this.lights.forEach(function(light) {