Turned dynamic lights back on
This commit is contained in:
@@ -530,7 +530,7 @@ GameState.prototype.create = function()
|
|||||||
|
|
||||||
this.shadowTexture = game.add.bitmapData(game.world.width, game.world.height);
|
this.shadowTexture = game.add.bitmapData(game.world.width, game.world.height);
|
||||||
// drop this lower to make the map darker
|
// drop this lower to make the map darker
|
||||||
this.shadowTextureColor = 'rgb(255, 255, 255)';
|
this.shadowTextureColor = 'rgb(30, 30, 30)';
|
||||||
|
|
||||||
// Create an object that will use the bitmap as a texture
|
// Create an object that will use the bitmap as a texture
|
||||||
this.shadowSprite = game.add.image(0, 0, this.shadowTexture);
|
this.shadowSprite = game.add.image(0, 0, this.shadowTexture);
|
||||||
@@ -541,22 +541,22 @@ GameState.prototype.create = function()
|
|||||||
|
|
||||||
// Create the lights
|
// Create the lights
|
||||||
this.staticLights = game.add.group();
|
this.staticLights = game.add.group();
|
||||||
// for (i = 0; i < 20 ; i++ ) {
|
for (i = 0; i < 20 ; i++ ) {
|
||||||
// this.staticLights.add(
|
this.staticLights.add(
|
||||||
// new Light(game,
|
new Light(game,
|
||||||
// game.rnd.integerInRange(0, game.width),
|
game.rnd.integerInRange(0, game.width),
|
||||||
// game.rnd.integerInRange(0, game.height),
|
game.rnd.integerInRange(0, game.height),
|
||||||
// game.rnd.integerInRange(0, 128),
|
game.rnd.integerInRange(0, 128),
|
||||||
// game.rnd.realInRange(0.0, 1.0),
|
game.rnd.realInRange(0.0, 1.0),
|
||||||
// [
|
[
|
||||||
// game.rnd.integerInRange(0, 255),
|
game.rnd.integerInRange(0, 255),
|
||||||
// game.rnd.integerInRange(0, 255),
|
game.rnd.integerInRange(0, 255),
|
||||||
// game.rnd.integerInRange(0, 255)
|
game.rnd.integerInRange(0, 255)
|
||||||
// ],
|
],
|
||||||
// flicker = [true, false][game.rnd.integerInRange(0, 1)]
|
flicker = [true, false][game.rnd.integerInRange(0, 1)]
|
||||||
// )
|
)
|
||||||
// );
|
);
|
||||||
// }
|
}
|
||||||
//this.movingLight = new Light(game, game.width/2, game.height/2);
|
//this.movingLight = new Light(game, game.width/2, game.height/2);
|
||||||
//this.lights.add(this.movingLight);
|
//this.lights.add(this.movingLight);
|
||||||
}
|
}
|
||||||
@@ -570,6 +570,7 @@ GameState.prototype.updateShadowTexture = function() {
|
|||||||
// underneath it darker, while the white area is unaffected.
|
// underneath it darker, while the white area is unaffected.
|
||||||
|
|
||||||
// Draw shadow
|
// Draw shadow
|
||||||
|
this.shadowSprite.bringToFront();
|
||||||
this.shadowTexture.context.fillStyle = this.shadowTextureColor;
|
this.shadowTexture.context.fillStyle = this.shadowTextureColor;
|
||||||
this.shadowTexture.context.fillRect(0, 0, game.world.width, game.world.height);
|
this.shadowTexture.context.fillRect(0, 0, game.world.width, game.world.height);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user