Started work on the light meter
This commit is contained in:
@@ -705,6 +705,9 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
var running = false;
|
var running = false;
|
||||||
var newstate = STATE_NONE;
|
var newstate = STATE_NONE;
|
||||||
|
|
||||||
|
if ( hasState(this, STATE_AWARE) ) {
|
||||||
|
|
||||||
|
|
||||||
if ( this.bubble_text !== null ) {
|
if ( this.bubble_text !== null ) {
|
||||||
if ( this.clear_bubble == true ) {
|
if ( this.clear_bubble == true ) {
|
||||||
this.bubble_text.destroy();
|
this.bubble_text.destroy();
|
||||||
@@ -786,6 +789,7 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
|
|
||||||
Phaser.Sprite.call(this, game, x, y, null);
|
Phaser.Sprite.call(this, game, x, y, null);
|
||||||
game.physics.arcade.enable(this);
|
game.physics.arcade.enable(this);
|
||||||
|
this.player_seen_timer = null;
|
||||||
this.can_move = 'true';
|
this.can_move = 'true';
|
||||||
this.collide_with_player = 'true';
|
this.collide_with_player = 'true';
|
||||||
this.collide_with_map = 'true';
|
this.collide_with_map = 'true';
|
||||||
@@ -877,6 +881,7 @@ GameState.prototype.create = function()
|
|||||||
spr.update_new_values();
|
spr.update_new_values();
|
||||||
}, this)
|
}, this)
|
||||||
player = this.add.sprite((20 * 32), (25 * 32), 'player');
|
player = this.add.sprite((20 * 32), (25 * 32), 'player');
|
||||||
|
player.lightmeter = 0;
|
||||||
};
|
};
|
||||||
if ( lp['collides'] == true ) {
|
if ( lp['collides'] == true ) {
|
||||||
this.map_collision_layers.push(layer);
|
this.map_collision_layers.push(layer);
|
||||||
@@ -1097,6 +1102,15 @@ GameState.prototype.check_input = function()
|
|||||||
GameState.prototype.update = function()
|
GameState.prototype.update = function()
|
||||||
{
|
{
|
||||||
this.check_input();
|
this.check_input();
|
||||||
|
|
||||||
|
lightcheck = [
|
||||||
|
this.shadowBuffer.getRGB(player.x, player.y),
|
||||||
|
this.shadowBuffer.getRGB(player.x + 32, player.y),
|
||||||
|
this.shadowBuffer.getRGB(player.x + 32, player.y + 32),
|
||||||
|
this.shadowBuffer.getRGB(player.x, player.y + 32)
|
||||||
|
];
|
||||||
|
|
||||||
|
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];
|
||||||
@@ -1108,7 +1122,6 @@ GameState.prototype.update = function()
|
|||||||
}
|
}
|
||||||
this.staticSounds.forEach(_fix_audio_relative, this);
|
this.staticSounds.forEach(_fix_audio_relative, this);
|
||||||
|
|
||||||
|
|
||||||
function _inner_collide(x) {
|
function _inner_collide(x) {
|
||||||
if ( x.collide_with_map == true ) {
|
if ( x.collide_with_map == true ) {
|
||||||
for ( var ln in this.map_collision_layers ) {
|
for ( var ln in this.map_collision_layers ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user