Look in random directions instead of always going clockwise

This commit is contained in:
2014-06-19 08:01:54 -07:00
parent 65226fc621
commit fff7593c91

View File

@@ -1008,6 +1008,7 @@ var AISprite = function(game, x, y, key, frame) {
while ( this.seen_directions.indexOf(newdirection) !== -1 ) {
newdirection = directions[game.rnd.integerInRange(0, 3)];
}
console.log("Setting new direction to " + newdirection);
setMovingState(this, newdirection);
this.animations.stop();
this.animations.play("bipedrun" + spriteFacing(this));