Stellar Objects


There are three types of stellar bodies in Boid Battles, the sun, black holes and planets. The planets are simply spheres with a texture, the black holes have a pure black material which prevents them from having lighting on the surface, giving the illusion they absorb all light. The sun is a little more complicated, it uses three different particle systems, the particle system making the surface of the sun uses  a yellow additivite texture which spawn rapidily around the sun in random places, so some sections appear to glow much brighter than others. The second system is the corona which gives the edges of the sun a soft red glow. The final system makes up the solar flares which use a custom texture made in photoshop for the particle and has a lot of rotation.

To make the planets orbit in a circle I made a function that, given an angle returns a point on a circle, where the x is cos(angle) and the y is sin(angle). By increasing the angle given to the function each frame and setting the planets positition to the point the planets orbit in a circle. The radius of the circle can be change by multipling the Vector2 the point is stored in by the radius. 

The black holes attract boids by first checking if any are within a certain radius then pulling the boids towards itself depending on how far away they are.

Leave a comment

Log in with itch.io to leave a comment.