More map work

This commit is contained in:
2014-06-15 18:55:34 -07:00
parent 3fe457a125
commit feaa2995b7

View File

@@ -760,6 +760,7 @@ var AISprite = function(game, x, y, key, frame) {
if ( animkey == "" ) if ( animkey == "" )
return; return;
this.bubble_immediate = true;
this.clearWordBubble(); this.clearWordBubble();
this.awareness_effect = game.state.states.game.add.sprite( this.awareness_effect = game.state.states.game.add.sprite(
this.x + 16, this.x + 16,
@@ -772,9 +773,14 @@ var AISprite = function(game, x, y, key, frame) {
this.enableWordBubble = function() { this.enableWordBubble = function() {
this.enable_word_bubble = true; this.enable_word_bubble = true;
this.timer = game.time.create(false); this.timer = game.time.create(false);
var timerdelta = 10000 + (game.rnd.integerInRange(0, 20) * 1000); if ( this.bubble_immediate == true ) {
timerev = this.timer.add(timerdelta, this.setWordBubble, this); this.bubble_immediate = false;
this.timer.start() this.setWordBubble();
} else {
var timerdelta = 10000 + (game.rnd.integerInRange(0, 20) * 1000);
timerev = this.timer.add(timerdelta, this.setWordBubble, this);
this.timer.start()
}
} }
this.clearWordBubble = function() { this.clearWordBubble = function() {
@@ -788,7 +794,9 @@ var AISprite = function(game, x, y, key, frame) {
this.setWordBubble = function() this.setWordBubble = function()
{ {
if ( this.bubble_text !== null || this.sprite_group == undefined || this.enable_world_bubble == false) { if ( this.bubble_text !== null ||
this.sprite_group == undefined ||
this.enable_world_bubble == false) {
return; return;
} }
@@ -946,6 +954,7 @@ var AISprite = function(game, x, y, key, frame) {
this.carries_light = 'false'; this.carries_light = 'false';
this.view_distance = 32 * 5; this.view_distance = 32 * 5;
this.timer = null; this.timer = null;
this.bubble_immediate = false;
this.bubble_text = null; this.bubble_text = null;
this.enable_word_bubble = false; this.enable_word_bubble = false;
this.body.collideWorldBounds = true; this.body.collideWorldBounds = true;
@@ -1024,7 +1033,7 @@ GameState.prototype.create = function()
this.aiSprites.forEach(function(spr) { this.aiSprites.forEach(function(spr) {
spr.update_new_values(); spr.update_new_values();
}, this) }, this)
player = this.add.sprite((10 * 32), (17 * 32), 'player'); player = this.add.sprite((19 * 32), (21 * 32), 'player');
player.lightmeter = 0; player.lightmeter = 0;
}; };