Making AI able to 'see' the player

This commit is contained in:
2014-06-14 15:49:39 -07:00
parent 1da32b44f8
commit 6c99d90e62

View File

@@ -623,7 +623,7 @@ var AISprite = function(game, x, y, key, frame) {
return false;
}
var sprrect = Phaser.Rectangle(spr.x, spr.y, spr.x + 32, spr.y + 32);
var sprrect = new Phaser.Rectangle(spr.x, spr.y, spr.x + 32, spr.y + 32);
if ( viewrect.intersects(sprrect) || viewrect.containsRect(sprrect) ) {
console.log("I SEE YOU YOU FUCKER");