Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make a sprite circle around a moving sprite?
- BucasBubbyloy
-
22 posts
How to make a sprite circle around a moving sprite?
I want to learn how to make a sprite circle around a moving sprite.


- ShinigamiBlacky
-
100+ posts
How to make a sprite circle around a moving sprite?
forever
change [counter v] by (1)
set x to (([x v] of [Sprite1 v]) + ([radius] * ([cos v] of (counter)))
set y to (([y v] of [Sprite1 v]) + ([radius] * ([sin v] of (counter)))
end
- Catalystix
-
100+ posts
How to make a sprite circle around a moving sprite?
ShinigamiBlacky is right. I made a simple demonstration of how it works using your mouse instead of a sprite.
https://scratch.mit.edu/projects/228646416/
https://scratch.mit.edu/projects/228646416/
- kieranblackley
-
500+ posts
How to make a sprite circle around a moving sprite?
To make that happen it will require a few variables. It is simple once you see though.
Here is what you need to do. In the sprite that is moving make 2 variables:

Once you have made them make this script in the sprite that is moving:

Now that you have made that script go into the sprite that moves around the object that is moving (that is quite a mouthful XD).
In this sprite make a define block. To make a define block go into more blocks and click make a block.
Click on the block you see in the window and type ‘find orbit’. Next click number input. In the input you see write ‘direction’.
Click ‘Ok’ and make this script with that hat/header block:

In the same sprite make this script:

I hope this works!
Next set the rotation style to “don't rotate”.
Here is what you need to do. In the sprite that is moving make 2 variables:

Once you have made them make this script in the sprite that is moving:

Now that you have made that script go into the sprite that moves around the object that is moving (that is quite a mouthful XD).
In this sprite make a define block. To make a define block go into more blocks and click make a block.
Click on the block you see in the window and type ‘find orbit’. Next click number input. In the input you see write ‘direction’.
Click ‘Ok’ and make this script with that hat/header block:

In the same sprite make this script:

I hope this works!

Next set the rotation style to “don't rotate”.
Last edited by kieranblackley (Oct. 26, 2018 18:50:18)
- DerpyHead0
-
1000+ posts
How to make a sprite circle around a moving sprite?
that makes a circle on the sprite, not around it. To make that happen it will require a few variables. It is simple once you see though.
-snip-
the topic has already been answered, it doesn't need more.
- BucasBubbyloy
-
22 posts
How to make a sprite circle around a moving sprite?
I have I more question, how do you make the spinning sprite circle around slower?
- badatprogrammingibe
-
500+ posts
How to make a sprite circle around a moving sprite?
Note: Due to scratch's messed up angle system, it is better to use the following:forever
change [counter v] by (1)
set x to (([x v] of [Sprite1 v]) + ([radius] * ([cos v] of (counter)))
set y to (([y v] of [Sprite1 v]) + ([radius] * ([sin v] of (counter)))
end
foreverThe counter in the above script represents the direction.
change [counter v] by (1)
set x to (([x v] of [Sprite1 v]) + ((radius) * ([sin v] of (counter)))
set y to (([y v] of [Sprite1 v]) + ((radius) * ([cos v] of (counter)))
end
- kieranblackley
-
500+ posts
How to make a sprite circle around a moving sprite?
I did not know there was a post before I sent mine.that makes a circle on the sprite, not around it. To make that happen it will require a few variables. It is simple once you see though.
-snip-
the topic has already been answered, it doesn't need more.
- raddersaurs
-
3 posts
How to make a sprite circle around a moving sprite?
you can just turn it around using costumes
But it depends on what speed you want
But it depends on what speed you want
Last edited by raddersaurs (Oct. 16, 2021 12:42:02)
- NG_Web
-
50 posts
How to make a sprite circle around a moving sprite?
This really helps, friends 

- Discussion Forums
- » Help with Scripts
-
» How to make a sprite circle around a moving sprite?