Close #44 : AI now stays where it's supposed to on initialization

This commit is contained in:
2014-07-06 20:52:47 -07:00
parent 1d689724d8
commit 5aaa025537
2 changed files with 42 additions and 33 deletions

View File

@@ -679,12 +679,14 @@ var AISprite = function(game, x, y, key, frame) {
this.action_wander();
}
}
this.update_new_values = function() {
if ( isSet(this.timer) )
this.timer.stop();
this.animations.destroy();
this.clearWordBubble();
this.origin.x = this.position.x;
this.origin.y = this.position.y;
this.state = STATE_UNAWARE;
this.view_distance = parseInt(this.view_distance);
this.state_changed_at = new Phaser.Point(this.x, this.y);
@@ -760,7 +762,7 @@ var AISprite = function(game, x, y, key, frame) {
this.view_distance = 32 * 5;
this.timer = null;
this.rotation_timer = null;
this.origin = new Phaser.Point(x, y);
this.origin = new Phaser.Point(this.x, this.y);
this.sprite_has_treasure = [true, false][game.rnd.integerInRange(0, 1)];
this.bubble_immediate = false;
this.bubble_text = null;