line tracing

Jim Hurley jhurley at infostations.com
Thu Jan 30 12:46:00 EST 2003


>  Roger Guay wrote:
>
>I would like to trace a line by moving a small brightly colored graphic
>(say via an equation of motion).  This would require that I prevent the
>screen from updating while the graphic is in motion.  I've done this in
>other APDs but I can't seem to find the way to do it in RR.  Any ideas?
>
>Thanks and Cheers, Roger

Roger,

Here is a quick and dirty script to simulate projectile motion. 
Create a button "ball" , preferably a radio button. The  pencil tool 
follows the button across the screen leaving a line (parabola) in its 
wake.

on mouseUp
   clean
   put 3 into vx
   put 4 into vy
   put 200 into x
   put 200 into y
   put .1 into gravity
   choose the  pencil tool

   repeat until y >200
     set the loc of button "ball" to x,y
     drag from round(x),round(y) to round(x+vx),round(y-vy)
     add vx to x
     add -vy to y --y coor is down on the screen
     subtract gravity from vy
   end repeat

   choose the browse tool
end mouseUp

on clean
   repeat until the number of images = 0
     delete image 1
   end repeat
end clean

-- 
Jim Hurley



More information about the use-livecode mailing list