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

#1 2007-12-19 21:01:05

randomdude
Scratcher
Registered: 2007-12-15
Posts: 28

How to make sprites jump and to learn about this .... yVelocity..

I have made some simple animations on random things on scratch. But I when tried making sprites "jump"....let's just say I was confused. I have tried downloading other scratch games to learn how they jump, but I didn't really understand any of it (with the exception of Archmage  smile  . All I know is that they involve something called "yVelocity" which can control gravity somehow and I managed to make a ball bounce up and down as it actually does in real life...somehow. I want to learn more about all this, because you see, I got hooked onto scratch because of my school. They showed us scratch and some of its basics and they also told us that they will be marking us about scratch and what we make on it. Also, I'm interested by Scratch.

Offline

 

#2 2007-12-19 21:23:48

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: How to make sprites jump and to learn about this .... yVelocity..

To jump you would usually set the yVelocity or gravity variable to a positive number.

I typed out a little code snippit of this @ http://scratch.mit.edu/forums/viewtopic.php?id=1887

The script is actually very simple. You should also try experimenting with the yVelocity variable more to see the results  smile

EDIT: Sorry, I forgot, if you want to make him go upwards increase the yVelocity variable and vice versa. This is good for jumping.

Last edited by archmage (2007-12-20 16:05:20)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#3 2007-12-20 10:49:10

randomdude
Scratcher
Registered: 2007-12-15
Posts: 28

Re: How to make sprites jump and to learn about this .... yVelocity..

thx man.... very useful...im writing this from school.....

Offline

 

#4 2007-12-21 23:58:07

EdnaC
Scratcher
Registered: 2007-08-28
Posts: 100+

Re: How to make sprites jump and to learn about this .... yVelocity..

The question of "Y_Velocity" and "gravity" and related topics appears pretty often in the forums.  I posted a one-sprite/one-script project to help illustrate it:

http://scratch.mit.edu/projects/EdnaC/70385#

I also did a follow up with "Bouncing" which is a lot like "Jumping".  Hope this helps...

Mr Ed

Offline

 

#5 2007-12-25 11:15:27

randomdude
Scratcher
Registered: 2007-12-15
Posts: 28

Re: How to make sprites jump and to learn about this .... yVelocity..

thx once again..

Offline

 

Board footer