Go back to text wordbubbles

This commit is contained in:
2014-06-14 10:09:46 -07:00
parent 5be0b54246
commit 7e3144dbc4

View File

@@ -793,6 +793,7 @@ 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;
} }
@@ -839,10 +840,6 @@ var AISprite = function(game, x, y, key, frame) {
{ {
var running = false; var running = false;
if ( game.rnd.integerInRange(0, 500) > 450 ) {
this.setWordBubble();
}
if ( this.bubble !== null ) { if ( this.bubble !== null ) {
if ( this.clear_bubble == true ) { if ( this.clear_bubble == true ) {
this.bubble.destroy(); this.bubble.destroy();
@@ -851,6 +848,8 @@ 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 )
@@ -908,9 +907,12 @@ var AISprite = function(game, x, y, key, frame) {
'townsfolk-guard-1', 'townsfolk-guard-1',
'townsfolk-guard-2' 'townsfolk-guard-2'
]; ];
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.body.collideWorldBounds = true; this.body.collideWorldBounds = true;
this.bubble = null;
this.enable_word_bubble = false;
this.sprite_name = "townsfolk-male-1"; this.sprite_name = "townsfolk-male-1";
this.sprite_group = "townsfolk-male"; this.sprite_group = "townsfolk-male";