I did my first try with Sprites and drawing.
It's a randomly moved circle.
There are two things that surprised me.
1. sprite often changes its speed significantly. The speed is constantly set to 1.
2. sprite's paths are not straight lines
Twice: why?
Code: Select all
@VERSION 2,0
@DISPLAY {Width = 640, Height = 480}
@SAMPLE 10, "Bells.wave"
/*
** Make the sprites. We create two sprites from each form: One for the
** background and one that is displayed below the mouse pointer.
*/
Function p_CreateSprites()
; Circle
SetFillStyle(#FILLCOLOR)
CreateBrush(10, 12, 12)
SelectBrush(10)
Circle(0, 0, 6, #WHITE)
EndSelect
SetBrushTransparency(10, #BLACK)
CreateSprite(1, #BRUSH, 10)
EndFunction
p_CreateSprites()
x1=0
y1=0
DisplaySprite(1, x1, y1)
Function p_MoveRnd()
x=Rnd(634)
y=Rnd(474)
Circle(x,y,3,#RED)
MoveSprite(1, x1, y1, x, y, {Speed=1})
PlaySample(10)
Circle(x,y,3,#BLACK)
x1=x
y1=y
EndFunction
EscapeQuit(True)
SetInterval(1, p_MoveRnd, 40)
;
; main loop!
;
Repeat
WaitEvent
Forever