Random planet generation function:

In order to create random planets, I’ve modified a similar function from the example I found:


I set global variables such as X,Y and Z positions, spawnMassLimit and spawnDistanceLimit which is then passed through the function paramaters into maths equations to generate random masses and positions.

At the end of this function i then call the create planet function, passing all of the randomly generated values as parameters.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s