Making AI able to 'see' the player

This commit is contained in:
2014-06-14 15:06:40 -07:00
parent df45cbd9e1
commit 956c66a886

View File

@@ -588,7 +588,7 @@ EffectSprite.prototype = Object.create(Phaser.Sprite.prototype);
EffectSprite.prototype.constructor = EffectSprite; EffectSprite.prototype.constructor = EffectSprite;
var AISprite = function(game, x, y, key, frame) { var AISprite = function(game, x, y, key, frame) {
this.canSeeSprite = function(spr, debug=false) { this.canSeeSprite = function(spr, debug) {
var xd = (spr.x - this.x); var xd = (spr.x - this.x);
if ( xd < 0 ) if ( xd < 0 )
xd = -(xd); xd = -(xd);