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

#1 2010-09-18 13:44:06

MachoWalrus
Scratcher
Registered: 2010-09-17
Posts: 9

Collide?

what is the script to make something colide-able? like, the person you control walks into something and can't move around it?

Offline

 

#2 2010-09-18 14:07:37

funnyman1120
Scratcher
Registered: 2008-07-31
Posts: 100+

Re: Collide?

MachoWalrus wrote:

what is the script to make something colide-able? like, the person you control walks into something and can't move around it?

you have to make boudtries i could make a tutorial for you if you want


Check out my website for updates on all your favorite games! Funnyman1120's Website

Offline

 

#3 2010-09-18 14:30:43

MachoWalrus
Scratcher
Registered: 2010-09-17
Posts: 9

Re: Collide?

Yeah, a tutorial would be nice.

Offline

 

#4 2010-09-18 18:19:33

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Collide?

The most simple way is color sensing:

[forever if <key [right] pressed?>]
[][change x by (5)]
[][if <touching color [ ]?>
[][][change x by (-5)]
[][end if]
[end forever if]

That's for the right arrow key - modify it for the other keys.

You could also use a sprite as the boundary:

[forever if <key [left] pressed?>]
[][change x by (-5)]
[][if <touching [Boundary]?>]
[][][change x by (5)]
[][end if]
[end forever if]

That was for the left arrow key - modify it for the others.

Any questions?


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

Board footer