From 22cbd2849a7fddc1e7cb27806a2e6a6738489bbd Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Sun, 22 Jun 2014 13:54:53 -0700 Subject: [PATCH] Face a random direction when you stop at a light --- moonlight/src/AISprite.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/moonlight/src/AISprite.js b/moonlight/src/AISprite.js index 3bb82c5..e493c15 100644 --- a/moonlight/src/AISprite.js +++ b/moonlight/src/AISprite.js @@ -171,9 +171,6 @@ var AISprite = function(game, x, y, key, frame) { aistate = "losthim"; break; } - default { - return; - } } var mylines = moonlightDialog['status'][this.sprite_group][aistate]; @@ -319,7 +316,7 @@ var AISprite = function(game, x, y, key, frame) { this.turnRandomDirection = function() { var directions = [STATE_FACE_DOWN, STATE_FACE_LEFT, STATE_FACE_RIGHT, STATE_FACE_UP]; - setMovingState(this, game.rnd.integerInRange(0, 3)); + setMovingState(this, directions[game.rnd.integerInRange(0, 3)]); this.animations.stop(); this.animations.play("bipedrun" + spriteFacing(this)); this.animations.stop();