From 6c1c0c1ba8e7719b19954a900270fdb63785bb79 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sat, 14 Jun 2014 16:50:57 -0700 Subject: [PATCH] Making AI able to 'see' the player --- moonlight/js/moonlight-skulk.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/moonlight/js/moonlight-skulk.js b/moonlight/js/moonlight-skulk.js index 7c79377..ceff10c 100644 --- a/moonlight/js/moonlight-skulk.js +++ b/moonlight/js/moonlight-skulk.js @@ -592,18 +592,18 @@ var AISprite = function(game, x, y, key, frame) { if ( hasState(this, STATE_FACE_LEFT) ) { return new Phaser.Rectangle(this.x, this.y - 32, -this.view_distance, - 64); + 96); } else if ( hasState(this, STATE_FACE_RIGHT) ) { return new Phaser.Rectangle(this.x + 32, this.y - 32, 32 + this.view_distance, - 64); + 96); } else if ( hasState(this, STATE_FACE_DOWN) ) { return new Phaser.Rectangle(this.x - 32, this.y + 32, - 64, - 32 + this.view_distance); + 96, + this.view_distance); } else if ( hasState(this, STATE_FACE_UP) ) { return new Phaser.Rectangle(this.x - 32, this.y, - 64, + 96, -this.view_distance); } else { return null;