Making dot move around

BlitzMax Forums/BlitzMax Programming/Making dot move around

You need to establish an amount of time between each decision about direction the ant makes.

So when the ant first starts, he would consider a direction and a time for which to travel that far. When that time has elapsed or if the ant reaches the edge of the screen, the direction and distance should be reconsidered. In order to ensure that the 'muscle spasm' problem doesn't happen, put a lower limit on the possible time between decision making (say min time: one second, max time: five seconds)

Edit: As a second thought, you would probably want to make sure that each 'new' direction was neither too close nor too far from the original direction. Otherwise the ant may appear to jerk, or will do stupid things like suddenly doing an about-turn.