ATB - You can use arrays to control the ball. An example:
randomize timer()
sync on
sync rate 42
hide mouse
dim ball(5)
ball(1) = screen width()/2 : rem x coord
ball(2) = screen height()/2 : rem y coord
ball(3) = rnd(4) + 3 : rem ballspeedx
if rnd(100) > 50 then ball(3) = ball(3) * -1
ball(4) = rnd(3) + 3 : rem ballspeedy
if rnd(100) > 50 then ball(4) = ball(4) * -1
ball(5) = 3 : rem sprite image
rem make ball
ink rgb(255,255,0),0
box 198,198,202,202
for i = 4 to 5
circle 200,200,i
next i
get image ball(5),195,195,206,206
cls
sprite 3,ball(1),ball(2),ball(5)
do
move_balls()
if escapekey()=1 then exit
sync
loop
show mouse
end
Function Move_Balls()
Rem move the ball in the X direction
ball(1) = ball(1) + ball(3)
Rem bounce the ball off the right and left edges
If ball(1) < 30
ball(1) = 30
ball(3) = ball(3) * -1
endif
if ball(1) > screen width() -35
ball(1) = screen width() -35
ball(3) = ball(3) * -1
endif
ball(2) = ball(2) + ball(4)
Rem move the ball in the Y direction
If ball(2) < 20
ball(2) = 20
ball(4) = ball(4) * -1
endif
If ball(2) > screen height() -6
ball(2) = screen height() -6
ball(4) = ball(4) * -1
endif
Rem draw the ball
sprite 3, ball(1), ball(2), ball(5)
endfunction
You idiots! You've captured their stunt doubles!