07-06-2023, 01:04 AM
(This post was last modified: 07-06-2023, 01:06 AM by TerryRitchie.)
Here is the simplest example I could come up with. This code creates 360 points around a circle. By varying XSIZE and YSIZE you can squash (YSIZE) or elongate (XSIZE) the ellipse.
Replace the CIRCLE command with your sprite's _PUTIMAGE statement.
Replace the CIRCLE command with your sprite's _PUTIMAGE statement.
Code: (Select All)
CONST RADIUS = 200
CONST XSIZE = 1
CONST YSIZE = .5
DIM x(359) AS SINGLE
DIM y(359) AS SINGLE
FOR i = 0 TO 359
x(i) = SIN(_D2R(i)) * RADIUS * XSIZE
y(i) = -COS(_D2R(i)) * RADIUS * YSIZE
NEXT i
SCREEN _NEWIMAGE(640, 480, 32)
CLS
i = 0
DO
_LIMIT 60
CLS
CIRCLE (319 + x(i), 239 + y(i)), 20
i = i + 1
IF i = 360 THEN i = 0
_DISPLAY
LOOP UNTIL _KEYDOWN(27)