--init t,f,b,w,h=tonum,flip,btn,128,128 w,h,x,y,y0,y1=w/2,h/2,0,0,0,0 r,s,l,dx,dy=3,w-5,20,1,1color(7) --update while abs(x)<w do x,y=x+dx,y+dy y0,y1=y0+t(b(3,1))-t(b(2,1)), y1+t(b(3,0))-t(b(2,0)) dx,dy=(x<r-s and abs(y-y0)<l or x>s-r and abs(y-y1)<l)and-dx or dx,(abs(y)<h-r)and dy or-dy --draw line(w-s,y0-l/2+h,w-s,y0+l/2+h) line(w+s,y1-l/2+h,w+s,y1+l/2+h) circfill(x+w,y+h,r)f()cls()end |
[Please log in to post a comment]