Making AI able to 'see' the player

This commit is contained in:
2014-06-14 15:22:39 -07:00
parent addf57729a
commit b31b7b310c

View File

@@ -614,6 +614,9 @@ var AISprite = function(game, x, y, key, frame) {
var p3 = new Phaser.Point(viewline.end.x, viewline.end.y);
var p4 = new Phaser.Point(viewline.end.x, viewline.end.y);
p4.rotate(p1.x, p1.y, 45, true);
if (debug == true )
console.log([p1, p2, p3, p4]);
/*
* ... In case this isn't obvious, this is the sprite's view cone: