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

#1 2011-01-14 15:03:44

Lookatme
Scratcher
Registered: 2009-12-27
Posts: 5

X and Y Velocity

I don't really understand about X and Y velocity. All of the good scratchers are doing it and I can't figure it out!  sad   sad  Super sad face... > sad

Offline

 

#2 2011-01-14 15:27:32

WeirdF
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: X and Y Velocity

Okay, well, just think of velocity as speed. X Velocity is the speed going horizontally (left and right), and Y Velocity is the speed going vertically (up and down).

Right, so imagine you have a script like this:

http://img718.imageshack.us/img718/7241/38400747.gif

Now, if we add velocity:

http://img820.imageshack.us/img820/6907/66200563.gif

It changes the speed at which the sprite is moving to the left and right. It always changes x by the variable "X Velocity," which is controlled by the left and right arrow keys.

Of course, that doesn't include slowing down if you aren't pressing anything, but that's a bit more advanced...

For more information, see Velocity on the Scratch Wiki.


http://i.cr3ation.co.uk/dl/s1/gif/847032b8a331def77529b6a0384db1fe_handfingers.gif

Offline

 

#3 2011-01-15 16:52:48

Lookatme
Scratcher
Registered: 2009-12-27
Posts: 5

Re: X and Y Velocity

Thank You!!!!!!!! :d

Offline

 

#4 2011-01-15 20:51:42

ZaRiTo
Scratcher
Registered: 2009-04-24
Posts: 100+

Re: X and Y Velocity

Wow, WeirdF. That was an awesome response. I've been using velocity for some time, and that was great. But may I suggest: Set X VELOCITY to X VELOCITY to X VELOCITY (*) 0.98 for friction. K?


Short Stories: Writing and Criticism
A Gallery for writers, readers, and everyone else.

Offline

 

#5 2011-01-17 07:37:06

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: X and Y Velocity

ZaRiTo wrote:

Wow, WeirdF. That was an awesome response. I've been using velocity for some time, and that was great. But may I suggest: Set X VELOCITY to X VELOCITY to X VELOCITY (*) 0.98 for friction. K?

That's really only necessary if there are areas with varying friction, but good point regardless.  smile


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer