Light meter

This commit is contained in:
2014-06-14 19:44:02 -07:00
parent 9bb65faf68
commit de101fe18f

View File

@@ -1099,21 +1099,14 @@ GameState.prototype.check_input = function()
GameState.prototype.update = function() GameState.prototype.update = function()
{ {
this.check_input(); this.check_input();
lightness = 0; lightcheck = [
this.shadowTexture.processPixelRGB( this.shadowTexture.pixels(player.x + player.y),
function(x) { this.shadowTexture.pixels(player.x + 32 + player.y),
var val = (x['r'] + x['g'] + x['b']) / 3; this.shadowTexture.pixels(player.x + 32 + player.y + 32),
if ( val > lightness ) this.shadowTexture.pixels(player.x + player.y + 32)
lightness = val; ];
return false;
},
this,
player.x,
player.y,
32,
32);
console.log(lightness); console.log(lightcheck);
for (var ln in this.map_collision_layers ) { for (var ln in this.map_collision_layers ) {
layer = this.map_collision_layers[ln]; layer = this.map_collision_layers[ln];