From 23507352b8de947a5b57a6f216d966a30c693889 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Thu, 19 Jun 2014 20:52:57 -0700 Subject: [PATCH] Making townsfolk report you to a guard --- moonlight/js/moonlight-skulk.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 966789e..9cd3a50 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -1061,8 +1061,11 @@ var AISprite = function(game, x, y, key, frame) { this.target = nearestInGroup(this, aiSprites, "townsfolk-guard"); } if ( this.target !== null ) { - if ( ((typeof this.target.canSeeSprite !== undefined) && - (this.target.canSeeSprite(this) == true)) || + var targetseesyou = false; + if ((typeof this.target.canSeeSprite !== undefined) && + (this.target.canSeeSprite(this) == true) ) + targetseesyou = true; + if ( targetseesyou || (game.physics.arcade.collide(this, this.target) == true) ) { if ( hasState(this, STATE_RUNNINGTOLIGHT) == true ) { return;