Very simple 2D game created for educational purposes back in 2008. It's written in C++ and uses allegro 4 library.
Recently the game was compiled and tested successfully on Fedora 25 with g++. Should compile and run under Windows/Mac also gcc.
Compile:
- install allegro 4.4.2
git clone https://github.com/tolivb/asteroids-cpp
cd asteroids-cpp/src
make
&&make install
- will compile and move the binarytbasteroids
to thebin
dir of the project
Run:
cd ../bin
&&./tbasteroids
- run the game from thebin
dir (if the binary is not in the same dir as the pictures it wont run!!!),
Compile:
- Download the old version of allegro liballegro442
unzip
to allegro442cd allegro442
&&cmake .
- make sure the dependencies are satisfiedmake
&&make install
If the install is successfull the following files should be present:
- /usr/local/include/allegro.h - your c++ compiler must know about this path( -I/usr/local/include/)
- /usr/local/lib/liballeg.so
You might need to run export LD_LIBRARY_PATH=/usr/local/lib
in order to prevent errors like this one:
./tbasteroids: error while loading shared libraries: liballeg.so.4.4:
cannot open shared object file: No such file or directory
Controlls:
- move up
UP ARROW
- move down
DOWN ARROW
- move left
LEFT ARROW
- move down
DOWN ARROW
- fire
SPACE
Rules:
- Space ship can crash on asteroids
- All bullets are absorbed by asteroids - you can hide behind asteroid
- When enemy bullet(red) hits our bullet(blue) they destroy each other
- Enemy ships are not affected by asteroids - they can fly over
- Enemy ships are resurrected - the game may never end
Many things can be improved:
- Add sound effects - onFire, onCrash, onExplosion
- Add visual effects - onFire, onCrash, onExplosion
- Add more fancy guns and enemies
- Migrate to allegro 5 - v4.4.2 is too old and probably not supported
- Better collisions
- Bugfixes...