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

#1 2011-05-12 14:55:19

diegobarle
Scratcher
Registered: 2011-04-26
Posts: 17

making a script

I need help to do a script that prohibits a character to pass over an object.

This script has to behave as "If on edge, bounce", but with an object.

Thanxs  big_smile

Offline

 

#2 2011-05-12 15:19:41

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: making a script

To make that work perfectly would unfortunately require a good deal of complex programming.  But to make it work roughly you can do something like this:
Make these costumes:
http://i52.tinypic.com/24v62va.gif Name this "sprite"
http://i54.tinypic.com/33vdn9z.gif Name this "up"
http://i55.tinypic.com/xelvdy.gif Name this "down"
http://i55.tinypic.com/9kpgk4.gif Name this "left"
http://i55.tinypic.com/2hi1myo.gif Name this "right"

Now put in this script:
http://i54.tinypic.com/25tb8lt.gif

It will bounce when it touches the sprite "object", but will not show any sensor sprites.  This will also make sure it does not overlap with sprite "object".

Last edited by Kileymeister (2011-05-12 15:21:36)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#3 2011-05-12 15:25:19

diegobarle
Scratcher
Registered: 2011-04-26
Posts: 17

Re: making a script

Thank you!  smile

Offline

 

Board footer