Nasos is an open source clone of Galaxian. My goal was to do some project using SDL2, and have some fun writing some code.
First you need to install some requirements:
# Fedora, Redhat, CentOS
sudo yum install autoconf automake libtool
sudo yum install SDL2-devel SDL2_gfx-devel SDL2_mixer-devel SDL2_ttf-devel
# Ubuntu
sudo apt install autoconf automake libtool
sudo apt install libsdl2-dev libsdl2-gfx-dev libsdl2-mixer-dev libsdl2-ttf-dev
Now, you can compile the game:
./autogen.sh
./configure
make
sudo make install
To run the game:
nasos
From the project directory, you can also run ./src/nasos without
installing it.
Move with the arrow keys or A/D and hold Space to fire. Press P to pause, R to restart, or Escape to return to the menu.
The first kill starts a three-second boost with one extra shot slot. Further kills add slots, up to five shots onscreen, but do not extend the timer. After the boost ends, a six-second cooldown prevents another boost, so extra capacity is available at most one-third of play time. Hits during cooldown still earn points. The HUD shows the recharge time. When the boost expires or you lose a life, capacity returns to one. Shots already flying finish their paths when the timer expires. Hold Space to use the extra slots. The HUD shows your capacity and remaining time. Formation kills earn 100 points; diving enemies earn 200. Clearing a wave awards 1,000 points and an extra life (up to five), then brings a faster, more aggressive formation. Your ship flashes during its three seconds of protection at the start of a wave and after respawning. The best score lasts for the current application session.
After make, run the gameplay and headless rendering checks from the
project directory:
cc -Iinclude -o /tmp/nasos-gameplay-test tests/gameplay_test.c \
src/gameplay.o src/gameplay_init.o src/gameplay_player.o \
src/gameplay_enemies.o src/gameplay_fire.o src/render_game.o \
src/display.o src/menu.o src/input.o \
-lSDL2 -lSDL2_ttf -lSDL2_gfx -lm
SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=dummy /tmp/nasos-gameplay-testThe code for this project is licensed under GNU GPL 2. You can see a copy of this license here.
All of the sound effects are downloaded from freesound.org.
All of the fonts are download from openfontlibrary.org.
The sprites are downloaded from spriters-resource.com.
