Making townsfolk report you to a guard

This commit is contained in:
2014-06-19 20:56:18 -07:00
parent 23148f4d6d
commit b1e350394c

View File

@@ -1066,12 +1066,9 @@ var AISprite = function(game, x, y, key, frame) {
if (this.target.canSeeSprite(this) == true) if (this.target.canSeeSprite(this) == true)
targetseesyou = true; targetseesyou = true;
} }
if ( targetseesyou || if ( targetseesyou ||
(game.physics.arcade.collide(this, this.target) == true) ) { (game.physics.arcade.collide(this, this.target) == true) ) {
if ( hasState(this, STATE_RUNNINGTOLIGHT) == true ) { if ( hasState(this, STATE_RUNNINGTOLIGHT) == false ) {
return;
} else {
console.log("My target can see me!"); console.log("My target can see me!");
this.path_tween_stop(); this.path_tween_stop();
this.path_purge(); this.path_purge();