Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make smooth rotation?
- 12artem12
-
14 posts
How to make smooth rotation?
I want to make a sprite rotating, and I want so when I press a button the rotation speed increases and when i release - decreases. I made the same thing with movement, but I can't do it with rotation though.
- 12artem12
-
14 posts
How to make smooth rotation?
Is there already existing code?Yea, but it's as simple as
when green flag clickedidk why the if blocks turned red
forever
if <key [up arrow v] pressed?> then
change [speed v] by (1)
end
if <not <key [up arrow v] pressed?>> then
change [speed v] by (-1)
end
end
when green flag clicked
forever
if <<(speed) = [0]> or <(speed) < [0]> then
set [speed v] to [0]
end
if <<(speed) = [21]> or <(speed) > [0]> then
set [speed v] to [21]
end
end
Last edited by 12artem12 (Today 14:23:38)
- 12artem12
-
14 posts
How to make smooth rotation?
This is great, but not what I needed. I want to rotate the sprite with buttons only. This should help:
https://scratch-mit-edu.ezproxyberklee.flo.org/projects/733613064
- ProfessorUelf
-
100+ posts
How to make smooth rotation?
So should it just turn up when pressing up, or start to rotate faster and faster?
- 12artem12
-
14 posts
How to make smooth rotation?
It should accelerate when the button is pressed to a certain limit, and when you release the button, on the contrary, it should slow down to zero. So should it just turn up when pressing up, or start to rotate faster and faster?
- Discussion Forums
- » Help with Scripts
-
» How to make smooth rotation?