Reset awareness timer when you get a new path that can see me
This commit is contained in:
@@ -1027,6 +1027,7 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
console.log("I am at the end of my path");
|
console.log("I am at the end of my path");
|
||||||
if ( this.canSeeSprite(player, false) == true ) {
|
if ( this.canSeeSprite(player, false) == true ) {
|
||||||
console.log("I can see the player");
|
console.log("I can see the player");
|
||||||
|
this.setAwarenessEffect(STATE_ALERTED);
|
||||||
this.path_set(player, true);
|
this.path_set(player, true);
|
||||||
this.path_tween_start();
|
this.path_tween_start();
|
||||||
} else {
|
} else {
|
||||||
@@ -1044,6 +1045,7 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
this.path_purge();
|
this.path_purge();
|
||||||
this.path_tween_stop();
|
this.path_tween_stop();
|
||||||
} else {
|
} else {
|
||||||
|
x.setAwarenessState(STATE_ALERTED);
|
||||||
this.path_tween_start();
|
this.path_tween_start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user