You are on your own for the rotation, but for the movement, just define a "Facing" variable, from 0 - 359. Then when you move the ant do this:
As for the food thing, just use a 2D distance function(abs(square root of (((point1.x - point2.x) squared) + ((point1.y - point2.y) squared)))) to check each food thing. If the distance is less then the radius of the circle, theres food.Code:Const RAD = 3.14159 / 180 Ant.X = Ant.X + Cos(Ant.Facing * RAD) Ant.Y = Ant.Y + Sin(Ant.Facing * RAD)
Z.




Reply With Quote