A 2D game inspired by Gem Swap and Space Invaders, Galaxy features an UFO avatar navigating through a grid of asteroids. The UFO avatar is trailed by a small goldfish (non-aggro) and can shoot other objects, create mini black holes, etc.
Preview
The following shows some of the implementations in action
Black hole | Explosion |
---|---|
![]() |
![]() |
![]() |
![]() |
WASD
to moveSPACEBAR
to shoot a projectile directly upwardsB
to spawn a black holeQ
to instigate a violent quakeHOLD MOUSE
to shoot constant stream of fireballs
- Grid - displays a n*n grid of asteroids (semi-transparent textured quads with different images).
- Quake - the visible window shakes violently accordingly to a high-freq sin function of time. During the quake, in every frame, all asteroids stand a 0.1% chance of disappearing.
- Dramatic exit - when asteroids disappearing due to Quake, they do so by quickly, but gradually shrinking to zero size, while rotating.
- Rocket science - movement is according to acceleration instead of constant speed.
- Shoot 'em up - when projectiles collide with other objects or fly a certain distance away from the avatar, they disappear. There is a cooldown time of ~2 seconds per shot.
- Path animation - some enemies move along parametric curves.
- Seeker - some enemies are constantly accelerated towards the avatar.
- BOOM! - when collision occurs, animated explosion is displayed using a semi-transparent quad, its texture including sprites of all movement phases, and the vertex shader adjusting texture coordinates to show the proper phase, received as a uniform parameter.
- Flamethrower - fired towards the location of the mouse.
- Black holes - attract other objects according to the Law of Gravitation.
- OpenGL
- GLUT
To render each texture properly, must hardcode the paths of each image file.