Go back to text wordbubbles
This commit is contained in:
@@ -780,6 +780,9 @@ 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);
|
||||||
|
timerev = timer.add(20000 + (game.rnd.integerInRange(0, 30) * 1000), this.setWordBubble, this);
|
||||||
|
timer.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
this.clearWordBubble = function() {
|
this.clearWordBubble = function() {
|
||||||
@@ -793,7 +796,6 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
this.setWordBubble = function()
|
this.setWordBubble = function()
|
||||||
{
|
{
|
||||||
if ( this.bubble !== null || this.sprite_group == undefined || this.enable_world_bubble == false) {
|
if ( this.bubble !== null || this.sprite_group == undefined || this.enable_world_bubble == false) {
|
||||||
console.log("Word bubble disabled");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -848,8 +850,6 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
} else {
|
} else {
|
||||||
this.snap_bubble_position();
|
this.snap_bubble_position();
|
||||||
}
|
}
|
||||||
} else if ( game.rnd.integerInRange(0, 500) > 450 ) {
|
|
||||||
this.setWordBubble();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( game.rnd.integerInRange(0, 100) < 95 )
|
if ( game.rnd.integerInRange(0, 100) < 95 )
|
||||||
@@ -881,6 +881,7 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
this.animations.destroy();
|
this.animations.destroy();
|
||||||
this.bubble = null;
|
this.bubble = null;
|
||||||
this.clearWordBubble();
|
this.clearWordBubble();
|
||||||
|
this.enableWordBubble();
|
||||||
this.state = STATE_UNAWARE;
|
this.state = STATE_UNAWARE;
|
||||||
|
|
||||||
this.loadTexture(this.sprite_name, 0);
|
this.loadTexture(this.sprite_name, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user