Based on Andreaz code
[pascal]
const
DEG_TO_RAD = PI / 180;
Circle_Radius = 50;
var
angle : Integer;
// another stuffs
procedure DrawScene;
begin
engine.clear;
Inc(angle);
if angle >= 360 then angle := 0;
CircleCX := plane.X + plane.W / 2;
CircleCY := plane.Y + plane.H / 2;
reticleCX := CircleCX + Circle_Radius * Cos(angle * DEG_TO_RAD);
reticleCY := CircleCY + Circle_Radius * Sin(Angle * DEG_TO_RAD);
plane.draw(plane.x,plane.y);
reticle.draw(reticleCX - reticle.W / 2, reticleCY - reticle.H / 2);
engine.flip;
end;[/pascal]
Works nice here, a ball moving in circles around something.
I have adapted from my engine code, hope you understand.
Bookmarks