Simplify random walk routine

This commit is contained in:
2014-06-19 08:15:17 -07:00
parent 927842ab61
commit 535953a245
2 changed files with 2 additions and 26 deletions

View File

@@ -1072,24 +1072,8 @@ var AISprite = function(game, x, y, key, frame) {
}
if ( game.rnd.integerInRange(0, 100) < 95 )
return;
switch ( game.rnd.integerInRange(0, 4) ) {
case 0: {
newstate = newstate | (STATE_FACE_RIGHT | STATE_MOVING);
break;
}
case 1: {
newstate = newstate | (STATE_FACE_LEFT | STATE_MOVING);
break;
}
case 2: {
newstate = newstate | (STATE_FACE_UP | STATE_MOVING);
break;
}
case 3: {
newstate = newstate | (STATE_FACE_DOWN | STATE_MOVING);
}
}
setMovingState(this, newstate);
this.turnUnseenDirection();
setMovingState(this, this.state | STATE_MOVING);
}
this.update = function()