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

#1 2011-11-02 09:26:57

Codebreaker
Scratcher
Registered: 2011-10-03
Posts: 100+

I need help with scripting

Okay, so I need some help with scripting. I have a sprite that has 26 costumes, and a wheel sprite. I set the wheel so that when the mouse clicks the wheel and rotates it, it spins. Is there any way to get the sprite with the costumes to change its costumes at the speed that the mouse is moving at?


Latest project: Pixelation/Upcoming project(s): M.A.Z.E Runner

Offline

 

#2 2011-11-02 09:41:36

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: I need help with scripting

I guess you can make a script to count how fast the mouse is moving. So save the mouse x and y into a variable and then have a [Reset Timer] and then the [wait until < >] block waiting until the mouse x or mouse y is not the one in the variables. When that is true, have an if statement to check if (timer) is less than 0.3 seconds for example and that means it's moving faster, then have another if statement that sees if it is greater than 0.3 and that will mean it is moving slower.

Though that is just my idea on how you could do it.

Offline

 

Board footer