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

#1 2007-10-22 08:07:24

Attish
Scratcher
Registered: 2007-10-19
Posts: 3

Need variable: speed!

I need the variable speed for a constantly moving sprite.
I am trying to make the speed work on a slider basis.
any Ideas?
Thanks.
Bye.

Offline

 

#2 2007-10-22 20:32:45

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Need variable: speed!

Create your own variable "speed" in pixels/second.

forever
     move 0.05*speed steps
     wait  0.05 seconds

Offline

 

#3 2007-10-23 07:01:25

Dthen
Scratcher
Registered: 2007-05-16
Posts: 26

Re: Need variable: speed!

yeh...

Forever
move (Speed) steps

Offline

 

#4 2007-10-23 08:45:46

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Need variable: speed!

Dthen, if you don't put a wait in your forever loops, they may behave very differently on different computers and in different scratch interpreters.

Offline

 

Board footer