How to randomly create Sprites outside a circle?

Hi, In my prototype shooter game I randomly generate enemies, but I want to generate enemies outside a circle. How do I achieve it?

can you give us some screenshoot

just create everywhere, and than delete those wich overlap with the circle.

1 Like

Can you give the code for it? Please

Can anyone please write code for this? Or at least give someclues for what to use

wich part isn’t clear enough?!

You’ve already been given a solution, it’s up to you to put it into practice.

Asking someone to do what what you want is very bad form.
I think it’s rude to say do what I want to do…

If the solution is no enough maybe the question is also not enough too.

Sorry I have no idea that’s why I’m asking

explore example file, learn this soft

I tried this . It’s not working.

I need astroid creation outside a circle(Invisible) with specified radius and center(planet in my case) and move towards player(planet).

I did but all astroids get deleted because of the circle.

You can try to use distance.

if timer “asteroid creation” is greater then 1 then
…create asteroid in random X, random Y
…,…if distance between asteroid and planet is below 500
…,…,…,…delete asteroid
…,…if distance between asteroid and planet is NOT below 500
…,…,…,…reset “asteroid creation”

This way you will not need the invisible circle. When you create the asteroid, if it is so close to your planet, it deletes itself, without reseting the timer, so it will be tried the next cycle. If the asteroid is in a valid distance, then the timer is reset.

Hope it helps