Go back to text wordbubbles

This commit is contained in:
2014-06-14 10:20:53 -07:00
parent eaad61aa4f
commit 2d870593bc

View File

@@ -780,7 +780,7 @@ function stringSize(str, font)
var AISprite = function(game, x, y, key, frame) { var AISprite = function(game, x, y, key, frame) {
this.enableWordBubble = function() { this.enableWordBubble = function() {
this.enable_word_bubble = true; this.enable_word_bubble = true;
timer = game.time.create(false); this.timer = game.time.create(false);
var timerdelta = 20000 + (game.rnd.integerInRange(0, 30) * 1000); var timerdelta = 20000 + (game.rnd.integerInRange(0, 30) * 1000);
console.log("In " + timerdelta + " ms, " + this + " will say something"); console.log("In " + timerdelta + " ms, " + this + " will say something");
timerev = timer.add(timerdelta, this.setWordBubble, this); timerev = timer.add(timerdelta, this.setWordBubble, this);
@@ -790,7 +790,7 @@ var AISprite = function(game, x, y, key, frame) {
this.clearWordBubble = function() { this.clearWordBubble = function() {
this.clear_bubble = true; this.clear_bubble = true;
this.enable_word_bubble = false; this.enable_word_bubble = false;
timer = game.time.create(false); this.timer = game.time.create(false);
var timerdelta = 20000 + (game.rnd.integerInRange(0, 30) * 1000); var timerdelta = 20000 + (game.rnd.integerInRange(0, 30) * 1000);
console.log("In " + timerdelta + " ms, " + this + " will enable speech"); console.log("In " + timerdelta + " ms, " + this + " will enable speech");
timerev = timer.add(timerdelta, this.enableWordBubble, this); timerev = timer.add(timerdelta, this.enableWordBubble, this);
@@ -832,7 +832,7 @@ var AISprite = function(game, x, y, key, frame) {
this.bubble_offsets = [ (this.body.width/2) + -(this.text_size[0] / 2), -( this.text_size[1]/2) ]; this.bubble_offsets = [ (this.body.width/2) + -(this.text_size[0] / 2), -( this.text_size[1]/2) ];
this.snap_bubble_position(); this.snap_bubble_position();
timer = game.time.create(false); this.timer = game.time.create(false);
timerev = timer.add(5000, this.clearWordBubble, this); timerev = timer.add(5000, this.clearWordBubble, this);
timer.start() timer.start()
} }
@@ -883,8 +883,8 @@ var AISprite = function(game, x, y, key, frame) {
} }
this.update_new_values = function() { this.update_new_values = function() {
this.timer.stop();
this.animations.destroy(); this.animations.destroy();
this.bubble = null;
this.clearWordBubble(); this.clearWordBubble();
this.state = STATE_UNAWARE; this.state = STATE_UNAWARE;