func displayball() dim x,y,vecx,vecy dim a,b,veca,vecb formbgcolor 240,232,144 formupdateautooff x=100 y=20 vecx=1 vecy=1 a=5 b=122 veca=3 vecb=0 loop: x=x+vecx y=y+vecy a=a+veca formcls formfillellipse x,y,20,20 formfillrect a,b,40,5 formupdate if y > 240 then vecy=-1 if x > 240 then vecx=-1 if y < 0 then vecy=1 if x < 3 then vecx=1 if a > 210 then veca=-1 if a < 5 then veca =1 if y=b then if x>a and x < a +40 then vecy=vecy * -1 endif endif goto loop endfunc