Discuss Scratch

joshuaho
Scratcher
1000+ posts

Slowing Down

Suppose that I make a sprite that is spinning. But if I wanted it to slow down until it stops, how can I do it, so that it slows down smoothly until it stops spinning?
adelk01
Scratcher
8 posts

Slowing Down

Hello
Take a look to this project. It is for you
http://scratch.mit.edu/projects/11324460/
I divided the path into 3 parts and for each part I changed the time of gliding. In the beginning it is fast and for the last third part it is slow.
Please, let me know if it helps. You can do it also into 4 different steps.
turkey3
Scratcher
1000+ posts

Slowing Down

You can make it turn by a variable called degrees, and ech time it turns change the degrees variable by (-.05) until it is < .001, if you know what I mean.
turkey3
Scratcher
1000+ posts

Slowing Down

joshuaho wrote:

Suppose that I make a sprite that is spinning. But if I wanted it to slow down until it stops, how can I do it, so that it slows down smoothly until it stops spinning?
I made a script here for you in my scripts sandbox at the bottom.
joshuaho
Scratcher
1000+ posts

Slowing Down

turkey3 wrote:

joshuaho wrote:

Suppose that I make a sprite that is spinning. But if I wanted it to slow down until it stops, how can I do it, so that it slows down smoothly until it stops spinning?
I made a script here for you in my scripts sandbox at the bottom.
Wait… it slows down, stops, but then starts turning again!

Last edited by joshuaho (July 10, 2013 03:26:34)

joshuaho
Scratcher
1000+ posts

Slowing Down

Bump… problem not resolved yet.
dracae
Scratcher
1000+ posts
turkey3
Scratcher
1000+ posts

Slowing Down

joshuaho wrote:

turkey3 wrote:

joshuaho wrote:

Suppose that I make a sprite that is spinning. But if I wanted it to slow down until it stops, how can I do it, so that it slows down smoothly until it stops spinning?
I made a script here for you in my scripts sandbox at the bottom.
Wait… it slows down, stops, but then starts turning again!
If that happens, then change the = 0 in the script to < 0
joshuaho
Scratcher
1000+ posts

Slowing Down

turkey3 wrote:

joshuaho wrote:

turkey3 wrote:

joshuaho wrote:

Suppose that I make a sprite that is spinning. But if I wanted it to slow down until it stops, how can I do it, so that it slows down smoothly until it stops spinning?
I made a script here for you in my scripts sandbox at the bottom.
Wait… it slows down, stops, but then starts turning again!
If that happens, then change the = 0 in the script to < 0
That did not work. Instead, it started turning the other way, then this way, and that way, then it stopped.

Last edited by joshuaho (July 11, 2013 04:19:17)

dracae
Scratcher
1000+ posts

Slowing Down

joshuaho wrote:

turkey3 wrote:

joshuaho wrote:

turkey3 wrote:

joshuaho wrote:

Suppose that I make a sprite that is spinning. But if I wanted it to slow down until it stops, how can I do it, so that it slows down smoothly until it stops spinning?
I made a script here for you in my scripts sandbox at the bottom.
Wait… it slows down, stops, but then starts turning again!
If that happens, then change the = 0 in the script to < 0
That did not work. Instead, it started turning the other way, then this way, and that way, then it stopped.
Did you see mine?
joshuaho
Scratcher
1000+ posts

Slowing Down

dracae wrote:

joshuaho wrote:

turkey3 wrote:

joshuaho wrote:

turkey3 wrote:

joshuaho wrote:

Suppose that I make a sprite that is spinning. But if I wanted it to slow down until it stops, how can I do it, so that it slows down smoothly until it stops spinning?
I made a script here for you in my scripts sandbox at the bottom.
Wait… it slows down, stops, but then starts turning again!
If that happens, then change the = 0 in the script to < 0
That did not work. Instead, it started turning the other way, then this way, and that way, then it stopped.
Did you see mine?
Weird… I used that script… but it did not work.

Last edited by joshuaho (July 11, 2013 18:53:41)

joshuaho
Scratcher
1000+ posts

Slowing Down

@turkey3 and dracae:
This is my project with the slow down script.

Last edited by joshuaho (July 11, 2013 18:56:36)

joshuaho
Scratcher
1000+ posts

Slowing Down

*sighs* I guess it is time for another little BUMP
Krammy
Scratcher
28 posts

Slowing Down

I believe this is what you need.
fleurymarc
Scratcher
71 posts

Slowing Down

joshuaho wrote:

*sighs* I guess it is time for another little BUMP

joshuaho wrote:

This is my project with the slow down script.


I believe that you can fix your specific issue by changing the test from “Spin speed = 0” to “Spin speed < 0”

But it's difficult to test because there are a few other issues with your scripts. I would suggest setting your variables to their starting values in the script that will use them.

(It's also strange that you are rotating the disc by 500 degrees. That's more than one complete spin each time that block gets run. A number like 50 probably makes more sense.


Marc.

Last edited by fleurymarc (July 13, 2013 22:48:58)

fleurymarc
Scratcher
71 posts

Slowing Down

I've remixed it with some fixes.

One of the things I changed was making it so that both the ON and OFF buttons are visible at the same time, but this was more just for testing. You should be able to change it back easily.



Marc.
joshuaho
Scratcher
1000+ posts

Slowing Down

fleurymarc wrote:

I've remixed it with some fixes.

One of the things I changed was making it so that both the ON and OFF buttons are visible at the same time, but this was more just for testing. You should be able to change it back easily.



Marc.
Thx!!
yagerdestroyer
Scratcher
1 post

Slowing Down

How do you get a sprite to slow down if your code looks like this???
Follow Link

https://scratch.mit.edu/projects/210004571/#editor
Bunney148
Scratcher
57 posts

Slowing Down

yagerdestroyer the link does not work.
deck26
Scratcher
1000+ posts

Slowing Down

yagerdestroyer wrote:

How do you get a sprite to slow down if your code looks like this???
Follow Link

https://scratch.mit.edu/projects/210004571/#editor
Please create your own topic rather than necroposting on a 5 year old topic.

Powered by DjangoBB