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

#1 2010-06-03 05:21:20

aaronaaronson
Scratcher
Registered: 2010-06-03
Posts: 1

How do i make my sprites fall if they jump off something?

how do you make sprites fall on sratch? my guy can run around and go up things and stuff, jup up on things, but he cant get down because when he walks off them he just floats! please can someone help me out my game could be so awesome it  is a shooter my first proper project and it is going really well if bots, and a multiplayer mode with various levels to choose from, i really want this to be a success so can someone please help me?

Offline

 

#2 2010-06-03 05:57:29

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

Re: How do i make my sprites fall if they jump off something?

Do something like:

[forever]
[][if <not <touching [Ground]?>]
[][][change y by (-5)]
[][end if]
[end forever]

Does that work?


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

Offline

 

#3 2010-06-03 06:52:36

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: How do i make my sprites fall if they jump off something?

As Jonathonpb shows above, you need to change the Y position of your sprite when it is not touching whatever you decide is "ground".  There are a number of ways to do this...using the Motion block "Change Y by " is probably the easiest.  For ground sensing, you can either use a color (with color sensing) or a sprite (with sprite touching sensing) or even a certain Y position of your sprite.   It's up to you  smile

If you need some examples, there are a bunch out there.  Here's a small gallery of demos and tutorials you might find useful

http://scratch.mit.edu/galleries/view/71745


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#4 2010-06-03 07:11:09

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: How do i make my sprites fall if they jump off something?

There are more advanced ways of doing this, but the one previously mentioned is the easiest.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

Board footer