Making AI able to 'see' the player
This commit is contained in:
@@ -625,20 +625,20 @@ var AISprite = function(game, x, y, key, frame) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ( hasState(this, STATE_FACE_LEFT) ) {
|
if ( hasState(this, STATE_FACE_LEFT) ) {
|
||||||
rotateAllpoints([p1, p2, p3, p4],
|
rotatePoints([p1, p2, p3, p4],
|
||||||
this.x + (this.body.width / 2),
|
this.x + (this.body.width / 2),
|
||||||
this.y + (this.body.height / 2),
|
this.y + (this.body.height / 2),
|
||||||
-90);
|
-90);
|
||||||
} else if ( hasState(this, STATE_FACE_RIGHT) ) {
|
} else if ( hasState(this, STATE_FACE_RIGHT) ) {
|
||||||
rotateAllpoints([p1, p2, p3, p4],
|
rotatePoints([p1, p2, p3, p4],
|
||||||
this.x + (this.body.width / 2),
|
this.x + (this.body.width / 2),
|
||||||
this.y + (this.body.height / 2),
|
this.y + (this.body.height / 2),
|
||||||
90);
|
90);
|
||||||
} else if ( hasState(this, STATE_FACE_DOWN) ) {
|
} else if ( hasState(this, STATE_FACE_DOWN) ) {
|
||||||
rotateAllpoints([p1, p2, p3, p4],
|
rotatePoints([p1, p2, p3, p4],
|
||||||
this.x + (this.body.width / 2),
|
this.x + (this.body.width / 2),
|
||||||
this.y + (this.body.height / 2),
|
this.y + (this.body.height / 2),
|
||||||
180);
|
180);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user