This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2007-05-15 12:57:42

Rajesh
Scratcher
Registered: 2007-05-15
Posts: 1

how to make sprite follow a pred-defined contour

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

 

#2 2007-05-16 08:17:39

johnm
Scratcher
Registered: 2007-03-08
Posts: 100+

Re: how to make sprite follow a pred-defined contour

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

 

Board footer