A sky full of stars

Hey there!

First piece of code, a night sky creator.

Basically, the code places multiple stars of different size on a surface, keeping track of the biggest ones. Later those are revisited creating links between the closer ones, but only including them in one constellation, so when the program connects enough stars it will start a new constellation, until there’re no more stars to visit.

May not be efficient, but I think the results are quite good. I should change the drawing part so the smallest stars would be drawn as one pixel and not two, I may change it later.

By the way, I’ve used the pygame package, you may need to install it if you want to use the code.


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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s