Making AI able to 'see' the player
This commit is contained in:
@@ -670,8 +670,10 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
if ( tl.intersects(sl) )
|
if ( tl.intersects(sl) )
|
||||||
return true;
|
return true;
|
||||||
}, this);
|
}, this);
|
||||||
if ( debug == true )
|
if ( debug == true ) {
|
||||||
console.log("contains ? " + sl.start.x + " " + sl.start.y);
|
console.log("contains ? " + sl.start.x + " " + sl.start.y);
|
||||||
|
console.log(viewcone);
|
||||||
|
}
|
||||||
if ( viewcone.contains(sl.start.x, sl.start.y) )
|
if ( viewcone.contains(sl.start.x, sl.start.y) )
|
||||||
return true;
|
return true;
|
||||||
}, this);
|
}, this);
|
||||||
|
|||||||
Reference in New Issue
Block a user