Any ideas on how to make sprite follow a pre-defined contour?
Also how can we draw an animate straight line or circle (e.g., start drawing a line from x=0, y=0 to x=120, y=0 as if one is drawing a physical line on a canvas)?
Offline
Hi, Rajesh.
One way to make a sprite follow a controur is shown in this project:
http://scratch.mit.edu/projects/Aardvark/139
The sprite uses two colored "whiskers" to detect when it is going off track and correct.
You can use a seqence of "glide" commands to approximate moving along a path. (A straight line is easy. A circle can be approximated by a number of short straight lines. An octagon looks roughly like a circle and you can increase the number of sides to get closer to an actual circle.)
-- John
Offline