The wander behavior

Wander is a state in which the agent is moving somewhat randomly around the game screen. Causing the direction of the enemy spaceship to rotate every frame randomly would result in very erratic behavior. Instead, there should be a random number of milliseconds (200-2,000) where the spaceship maintains its current direction. When the ship has gone the random number of milliseconds, it should randomly choose to turn left or turn right, but should have a biased chance of turning in the same direction it did the previous time, with that bias decreasing each time it chooses the same direction after the initial choice. That will give the wandering behavior a little more consistency and appear a little less jittery.

See how the wander behavior chooses a point at random and moves toward it:

Demonstrating the wander behavior