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

#1 2011-11-30 20:36:39

codes321
Scratcher
Registered: 2011-10-19
Posts: 78

How do I use Velocities?

Hi everyone? Do you know how to use velocities? It's orange, so it looks like a variable, but I couldn't find it in my list of variable scripts. Can anyone help? Thanks a lot!  tongue


Check out my projects!  roll   roll   roll   roll   roll   roll   roll   roll   roll   roll   roll

Offline

 

#2 2011-11-30 21:03:31

luiysia
Scratcher
Registered: 2011-07-05
Posts: 1000+

Re: How do I use Velocities?

You have to add it. If you use an imported script, just add all the variables in the script.


http://i50.tinypic.com/dx00pd.gif

Offline

 

#3 2011-11-30 21:21:27

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: How do I use Velocities?

It is orange and looks like a variable because it is a variable.  As luiysia said, if you imported the script, you  may have to make the variables.  You may even have to replace all of them with exact duplicates, I'm not exactly sure  hmm .  I think private variables that don't exist are automatically created though.

If you're trying to make your own script, your velocity just hold a number, which is the amount that your sprite changes each frame (e.g. if the x-velocity is 4, change the sprite's x position by 4 each frame).


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#4 2011-12-01 09:11:15

codes321
Scratcher
Registered: 2011-10-19
Posts: 78

Re: How do I use Velocities?

luiysia wrote:

You have to add it. If you use an imported script, just add all the variables in the script.

Thanks.


Check out my projects!  roll   roll   roll   roll   roll   roll   roll   roll   roll   roll   roll

Offline

 

#5 2011-12-01 09:12:31

codes321
Scratcher
Registered: 2011-10-19
Posts: 78

Re: How do I use Velocities?

MoreGamesNow wrote:

It is orange and looks like a variable because it is a variable.  As luiysia said, if you imported the script, you  may have to make the variables.  You may even have to replace all of them with exact duplicates, I'm not exactly sure  hmm .  I think private variables that don't exist are automatically created though.

If you're trying to make your own script, your velocity just hold a number, which is the amount that your sprite changes each frame (e.g. if the x-velocity is 4, change the sprite's x position by 4 each frame).

Thanks!


Check out my projects!  roll   roll   roll   roll   roll   roll   roll   roll   roll   roll   roll

Offline

 

#6 2011-12-01 12:00:06

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How do I use Velocities?

There are lots of different methods for velocity, but I prefer to use one I made up myself. It's a little more complicated than other methods, but I think it works better as you can choose the maximum speed as well. I'll just go and create it and take a screenshot of it.

EDIT: Got it!  smile
Sorry about the poor quality, I've just realised I saved it as a JPEG instead of a PNG...
http://i40.tinypic.com/2n0shp2.jpg

Last edited by RedRocker227 (2011-12-01 12:02:39)


Why

Offline

 

Board footer