Light meter

This commit is contained in:
2014-06-14 19:16:36 -07:00
parent a8fa388d45
commit ecd70d5299

View File

@@ -962,8 +962,6 @@ GameState.prototype.updateShadowTexture = function() {
this.shadowTexture.context.fillStyle = gradient;
this.shadowTexture.context.arc(light.x + 16, light.y + 16, radius, 0, Math.PI*2);
this.shadowTexture.context.fill();
this.shadowTexture.update(light.x - radius, light.y - radius,
radius * 2, radius * 2);
}, this);
this.shadowTexture.dirty = true;
@@ -1101,6 +1099,7 @@ GameState.prototype.check_input = function()
GameState.prototype.update = function()
{
this.check_input();
this.shadowTexture.update(player.x, player.y, 32, 32);
lightcheck = [
this.shadowTexture.getPixelRGB(player.x, player.y),
this.shadowTexture.getPixelRGB(player.x + 32, player.y),