Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make smooth rotation?
- 12artem12
-
13 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
-
13 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
-
13 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
- Discussion Forums
- » Help with Scripts
-
» How to make smooth rotation?