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

#1 2012-03-08 00:28:47

Freedom_hunter
New Scratcher
Registered: 2012-02-28
Posts: 1

how to increase the speed of sprites as the level increases?

hi,

i made it so the variable "level" increases every time i get 10 points. But i want to increase the speed of the sprite as the level increases. How should i do it?

thanks in advance

Offline

 

#2 2012-03-08 05:02:27

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: how to increase the speed of sprites as the level increases?

How does your sprite move? Do you use "Move () steps" or "Change x/y by ()" or "Set x/y to ()" or "Glide () sec to"? There's a different method for each...


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#3 2012-03-08 11:03:43

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

Re: how to increase the speed of sprites as the level increases?

Hardmath123 wrote:

How does your sprite move? Do you use "Move () steps" or "Change x/y by ()" or "Set x/y to ()" or "Glide () sec to"? There's a different method for each...

^This.

If it's the former, put:

move ((Level)*[5]) steps//Change the "5" to a value of your choice.
If it's the latter, put:
glide ([10]-(Level)) secs to x: [ ] y: [ ]//Change the "10" to the amount of levels there are.

Last edited by RedRocker227 (2012-03-08 11:04:05)


Why

Offline

 

#4 2012-03-08 14:11:35

turkey3
Scratcher
Registered: 2011-12-04
Posts: 500+

Re: how to increase the speed of sprites as the level increases?

Make it like this:

When gf clicked
Forever
Point toward [mouse-pointer v]
Move (timer) steps
I'm just assuming you're pointing toward the mouse

Offline

 

#5 2012-03-10 03:45:17

Splodgey
Scratcher
Registered: 2011-04-26
Posts: 500+

Re: how to increase the speed of sprites as the level increases?

turkey3 wrote:

Make it like this:

When gf clicked
Forever
Point toward [mouse-pointer v]
Move (timer) steps
I'm just assuming you're pointing toward the mouse

It's as the level increases not the time anyway. That would get ridiculously fast. Use this:

When gf clicked
Forever
point towards [mouse-pointer v]
Move (((level) * (acceleration)) + [1]) steps
Alternatively, use this:
When gf clicked
Forever
set [velocity] to  (((level) * (acceleration)) + [1])
if <key [up arrow v] pressed?>
change y by  (velocity)
end
if <key [down arrow v] pressed?>
change y by  ([0] - (velocity))
end
if <key [right arrow v] pressed?>
change x by  (velocity)
end
if <key [left arrow v] pressed?>
change x by  ([0] - (velocity))

Last edited by Splodgey (2012-03-10 03:46:43)

Offline

 

Board footer