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

#26 2007-12-20 19:10:15

Toes
Scratcher
Registered: 2007-12-01
Posts: 2

Re: gravity in projects

<change{y velocity }by(0.1? What does all that mean?

Offline

 

#27 2007-12-20 22:54:10

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: gravity in projects

"Velocity" is in other words "speed". "Y velocity" or "y speed" means the vertical movement rate of the sprite.


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#28 2007-12-20 23:34:48

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

Re: gravity in projects

Velocity is something you will have to program into your project.  X means position in the right or left direction, while Y means position up or down.  Velocity is how much the position of something changes for each "time step".

So: you could program a sprite to move a certain amount each time that a "forever" loop occurs.  The sprite would change its "X" by X_Velocity and its "Y" by Y_Velocity each time thru the loop.  (Y_Velocity is just a variable name that I've chosen, you could call it anything you wanted.)

Gravity makes an object increase in its "Y Velocity" unless something is preventing it from falling.  If you walk across a mountain, the ground below you keeps you from falling and your "Y Velocity" remains Zero.  If you walk off the edge, and no longer have anything to stop your Y Velocity from being increased by gravity, you fall, as illustrated by unfortunate "GravityGuy":

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

-Mr Ed

Last edited by EdnaC (2007-12-21 08:38:14)

Offline

 

Board footer