Moved to graphical word bubbles

This commit is contained in:
2014-06-12 02:09:20 -07:00
parent df4d392132
commit ba16a99ba9

View File

@@ -536,11 +536,12 @@ var AISprite = function(game, x, y, spritetype) {
} }
this.clearWordBubble = function() { this.clearWordBubble = function() {
this.bubble.destroy(); if ( this.bubble !== null )
this.bubble.destroy();
this.bubble = null; this.bubble = null;
this.enable_word_bubble = false; this.enable_word_bubble = false;
timer = game.time.create(false); timer = game.time.create(false);
timerev = timer.add(10000, this.enableWordBubble, this); timerev = timer.add(10000 + (game.rnd.integerInRange(0, 10) * 1000), this.enableWordBubble, this);
timer.start() timer.start()
} }
@@ -635,7 +636,7 @@ var AISprite = function(game, x, y, spritetype) {
'townsfolk-guard-1', 'townsfolk-guard-1',
'townsfolk-guard-2' 'townsfolk-guard-2'
]; ];
this.bubble = null; this.clearWordBubble();
this.state = STATE_UNAWARE; this.state = STATE_UNAWARE;
Phaser.Sprite.call(this, game, x, y, spritenames_by_type[spritetype]); Phaser.Sprite.call(this, game, x, y, spritenames_by_type[spritetype]);