Making townsfolk report you to a guard
This commit is contained in:
@@ -1061,7 +1061,8 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
this.target = nearestInGroup(this, aiSprites, "townsfolk-guard");
|
this.target = nearestInGroup(this, aiSprites, "townsfolk-guard");
|
||||||
}
|
}
|
||||||
if ( this.target !== null ) {
|
if ( this.target !== null ) {
|
||||||
if ( (this.target.canSeeSprite(this) == true) ||
|
if ( (typeof this.target.canSeeSprite !== undefined &&
|
||||||
|
(this.target.canSeeSprite(this) == true)) ||
|
||||||
(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) == true ) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user