Battle Planets
Todd Bertorelli
Description

Battle Planets is a top-down physics game.

To win, you must knock all other planets into deep space while remaining within the solar system.

Each planet is capable of propelling itself and launching asteroids. Stars pull on each planet with their gravity, and launch away planets that touch them.

At the start, all planets are aligned
Graphics Features
  • Phong Lighting
    • Supports multiple lights and colors
    • Supports diffuse and specular texture sampling
  • Specular and diffuse texturing
  • Light halos
  • Cube-mapped skybox

Lights for each object are blended together by multiplying the results of each light's specular and diffuse computations. Ambient lighting is added at the end.

Many textured objects are supported at once. A cube-mapped starscape follows the user's camera while it tracks on their planet.

Earth shoots asteroids at venus
Light emitters have thick halos.
Some planets have atmospheric halos
All stars give off their own light
Physics Features
  • 3D spherical collision detection
  • Perfectly elastic sphere to sphere collisions
  • Newtonian gravity simulation

Many objects are supported at a time, and each objects velocity and position vectors are computed by integration each game tick.

Each star in the scene pulls on other objects based on Newton's gravity equation.

Earth shoots asteroids at venus
Graivty from the surrounding stars pulls the planets off course