zsmb's prog site

Spaaaaace

  2015.08.15.

Introduction

I used to play a game that was something like this on Windows 98, it was on a floppy disk that had a whole collection of games. While I had no idea about its name, I very quickly found  Asteroids, which apparently is quite popular, and what I used to play was either a rare version or a copy of it. Anyhow. This project is a very simple Asteroids-like game, only a ship and the colourful asteroids in the vast nothingness of space.

Development

This project has been put aside for some time because of some difficulties with getting the rendering working, but I finally got around to looking up how to deal with SDL2 transparency properly. There aren't really any interesting solutions in the game, the code however is better documented than usual (I didn't generate the Doxygen documentation for it, but it would probably be pretty neat - I might add it later).

Design choices

There is no menu in the game, because creating that would've taken as much time as making the actual gameplay. Unfortunately, this also means that you'll have to relaunch the game every time you fail a level - working around this proved a bit too complicated to implement for now (at least without using goto statements).

There's also no score keeping in the game, although it would be very easy to add. This, for one, is because of the aforementioned lack of a menu, but also because the asteroids that appear on each levels are randomized in size (only the quantity is predetermined), therefore high scores wouldn't provide a fair comparison of performance.

There are some parameters of the game (maximum number of projectiles on screen, maximum age of projectiles, etc.) that you can adjust easily if you're self-compiling the game - a search for "adjust" in the source code should find all of them.

Controls

You can move the ship with WASD or the arrow keys, aim with the mouse, and fire projectiles with the left mouse button.

Running the game

For Windows, you can download the compiled executable zipped with all the dependencies to play this game. If you want to compile it from source, you'll need  SDL2,  SDL2_image, and  SDL2_gfx. You will also need to use the -std=c++11 flag, since the code has some C++11 features in it (at the very least it uses the auto keyword, but there might be more).

On Linux, you'll need g++, libsdl2-dev and libsdl2-image-dev to compile, and you can use the included Makefile in the archive below.

Downloads

Downloading the zip file that contains the executable results in a warning (at least in Chrome) as a security measure, but you can choose to "Keep" it.

Name Description Size Date
spaaaaace.cpp Source code 19 KB 2015.08.15.
spaaaaace.zip Windows executable with dll's 1539 KB 2015.08.15.
spaaaaace_assets.zip Only the textures used 302 KB 2015.08.15.
spaaaaace.tar.gz Linux project with Makefile and SDL_gfx 256 KB 2015.08.15.

The project's name

Warning: loud and high pitched noise.  Spaaaaaaaaaace.