Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Sprite moving in circle around a central point
- Code_Name_Geek
-
100+ posts
Sprite moving in circle around a central point
Does anyone know how to make a sprite move in a circle around a central point?
- Dreamo
-
500+ posts
Sprite moving in circle around a central point
It's easy. When you go to the costume editor, you will see there is a cross in the middle. That is the central point your sprite will be rotating around. Then, just use this script to move the sprite around that central point:
Hopefully I helped
Hopefully I helped

- Alberknyis
-
1000+ posts
Sprite moving in circle around a central point
Central point will be somewhere on the map.
So it will have the values X,Y.
Sorry, I was in a rush. Tell me if there's a problem.
So it will have the values X,Y.
Sorry, I was in a rush. Tell me if there's a problem.
- Code_Name_Geek
-
100+ posts
Sprite moving in circle around a central point
Okay, I understand now. Thanks for the help guys!
- Moltastro
-
5 posts
Sprite moving in circle around a central point
@alberknyis
how are you supposed to write the start position?
how are you supposed to write the start position?
- awesomeawesxomeman3
-
62 posts
Sprite moving in circle around a central point
@alberknyis
how are you supposed to write the start position?
it's not really a start position, but rather a start angle. (note that sine and cosine work through radians, so you should convert degrees to radians when adjusting that number. Example below)
also, please refrain from bumping old threads
Last edited by awesomeawesxomeman3 (Jan. 1, 2018 21:32:15)
- alexgiurumescu
-
99 posts
Sprite moving in circle around a central point
This script is correct, it is one that is effective because you can change it easily. Central point will be somewhere on the map.
So it will have the values X,Y.
Sorry, I was in a rush. Tell me if there's a problem.
- BuzzFun
-
15 posts
Sprite moving in circle around a central point
What if your “central point” is a sprite that moves around?
- deck26
-
1000+ posts
Sprite moving in circle around a central point
Makes no difference! Either save the position when you start moving the circling sprite (Center X, Center Y above) or use the current position of the centre sprite in the goto x, y equations. What if your “central point” is a sprite that moves around?
- BuzzFun
-
15 posts
Sprite moving in circle around a central point
I meant like if you are making a dodgeball game and you want the character to turn around with the ball in its hands, and that character will move around and occasionally need the ball to “circle around” it.
- wolfbomb
-
14 posts
Sprite moving in circle around a central point
I meant like if you are making a dodgeball game and you want the character to turn around with the ball in its hands, and that character will move around and occasionally need the ball to “circle around” it.
just set centre X and centre Y to the player's position. You can turn the script into a custom block and then only call it when you need it. Furthermore, if you want the object to revolve around a point at exactly the point it started at, calculate the distance between the points using trig.
Last edited by wolfbomb (Feb. 15, 2022 02:44:32)
- alboxer2000
-
500+ posts
Sprite moving in circle around a central point
There's another way:
Or you can replace this block:
With:
Sorry for this scratchblocks things…
Last edited by alboxer2000 (April 30, 2022 16:40:10)
- alboxer2000
-
500+ posts
Sprite moving in circle around a central point
there are no problems Central point will be somewhere on the map.
So it will have the values X,Y.
Sorry, I was in a rush. Tell me if there's a problem.

- Discussion Forums
- » Help with Scripts
-
» Sprite moving in circle around a central point