# How do I spawn objects around a planet?

Get help using Construct 2

### » Wed Dec 23, 2015 7:00 pm

Hi,
i want to add a world generator to my game that spawns objects randomly around planets. The objects should spawn at a specific distance because the planet has a range in which it pulls objects to itself with the platform behaviour.
Here is a screenshot of my game with a planet:
The red line shows where the objects should be spawned.
After they are spawned they will be pulled to the planet automatically (If they are touching the atmosphere) so everything i would like to know is how to find the right X and Y coordinates when the objects are spawned.
Thanks!
B
5
S
3
Posts: 193
Reputation: 1,063

### » Wed Dec 23, 2015 7:09 pm

You should look at using parametric circle equations.
https://en.wikipedia.org/wiki/Parametri ... ion#Circle
http://www.mathopenref.com/coordparamcircle.html <--- for generic circle (of arbitrary radius)

Then just spawn it at a random t-value between 0 and 2pi.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

### » Thu Dec 24, 2015 9:23 pm

Thanks I'll have a look at that
B
5
S
3
Posts: 193
Reputation: 1,063

### » Thu Dec 24, 2015 9:59 pm

@gumshoe2029,
Thanks for your help! It works now
Thanks again!
B
5
S
3
Posts: 193
Reputation: 1,063

### » Tue Jan 05, 2016 4:43 pm

https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

### » Sat Feb 06, 2016 11:03 pm

Anyone care to share capx example on this one? Thanks!
B
15
S
7
G
34
Posts: 55
Reputation: 18,478

### » Fri Feb 26, 2016 8:26 pm

@bloodshot,
Here is an example:
I hope it helps!
B
5
S
3
Posts: 193
Reputation: 1,063

### » Fri Feb 26, 2016 9:04 pm

Hi, @aquadijoib! Thank you. That was excellent! How is the game coming btw? Screenshot looks cool. Would love to give it a testdrive. cheers!
B
15
S
7
G
34
Posts: 55
Reputation: 18,478

### » Sat Feb 27, 2016 12:16 pm

@bloodshot I'm glad it helped! I'm currently working on the crafting system for my game. I created a thread for that here on the forum. Also when the game is in a more finished state I would love to send a version to you for testing!
B
5
S
3
Posts: 193
Reputation: 1,063