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

#1 2011-12-24 10:34:12

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

What should I do???????

I want to make a Christmas game where Santa is trying to get to some houses but you have to draw a path for him to follow. How do I make him follow the path?????  hmm  ??????????????????????????????????? :?


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#2 2011-12-24 11:52:53

Freakish
Scratcher
Registered: 2011-10-25
Posts: 1000+

Re: What should I do???????

First, this shouldn't go in requests. It should be in All About Scratch.

Anyways, you would first make 2 lists and call them "x" and "y" and also make a variable called "list number".


Then you do,
When mouse is down
<repeat until mouse is not down>
add mouse x to "x"
add mouse y to "y"
</repeat until mouse is not down>

Then, on the Santa Sprite,
you would do this:

<flag clicked>
<set "list number" to 0>
<forever>
<if>
<mouse is down>
<wait until mouse is not down>
<repeat -length of x-
<set x to <item "list number> of x>
<set y to <item "list number> of y>
change "list number" by 1
</if>
</forever>

And that should do it!  smile


http://i.imgur.com/y3RBV.jpg

Offline

 

Board footer