AI returns to their origin when they cant move and are in wandering state. AI gets their facing state from the map. Guards can re-encounter you while traveling back to the origin.

This commit is contained in:
2014-06-27 18:04:34 -07:00
parent 6873a1ba53
commit 9709a87fb0
4 changed files with 26 additions and 14 deletions

View File

@@ -23,7 +23,7 @@ GameState.prototype.create = function()
);
if ( lp['inject_sprites'] == true ) {
this.aiSprites = game.add.group();
this.aiSprites.debug = false;
this.aiSprites.debug = true;
this.map.createFromObjects('AI', 3544, 'player', 0, true, false, this.aiSprites, AISprite);
this.aiSprites.forEach(function(spr) {
spr.update_new_values();
@@ -285,7 +285,7 @@ GameState.prototype.update = function()
this.aiSprites.forEach(_inner_collide, this);
this.updateShadowTexture();
if ( this.aiSprites.debug == true ) {
if ( this.aiSprites.debug == false ) {
function _draw_viewrect(x) {
var r = x.viewRectangle();
if ( isSet(r) == false )