Light meter

This commit is contained in:
2014-06-14 20:12:34 -07:00
parent a645753f68
commit b16acf8de1

View File

@@ -1101,7 +1101,7 @@ GameState.prototype.check_input = function()
GameState.prototype.update_player_lightmeter = function() { GameState.prototype.update_player_lightmeter = function() {
lightValue = 0; lightValue = 0;
this.staticLights.forEach(function(light) { this.staticLights.forEach(function(light) {
line = new Phaser.line(player.x + 16, player.y + 16, light.x, light.y); line = new Phaser.Line(player.x + 16, player.y + 16, light.x, light.y);
if ( line.length > light.radius ) if ( line.length > light.radius )
return; return;
var lv = light.light_meter - (Number(line.length) / light.radius); var lv = light.light_meter - (Number(line.length) / light.radius);