SInvanders is a platform indepedent SDL implementation of famous Space Invanders game. I wrote it as SDL for S60 has created some confusion how SDL can be used in S60 Symbian environment without single line of Symbian code. So I started to do this Space Invanders application as an example. It is almost entirely written using Xcode on OSX and then just compiled to other platforms. I decided to use C++ and STL just for challenge, traditional C version could be more compact, but naturally I did this for demonstration, fun and learning purposes.
The graphics are butt ugly - I definitely payed no effort to them or audio clips - however both of those are easily replaceable by talented designer. See sinvander_info.txt to get an idea. If you do upgraded graphics, or get SInvanders to be compiled to other platforms, please let me know and Im able to share them here.
Controls
sinvander_info.txt file defines appearance of game. You can create a own graphics and audio and use them instead of default ones: Create a own info file. It MUST be named like ANYNAME_info.txt, where ANYNAME can be any filename. E.g. your info file is then 'myowinfo_info.txt'. When '0' or 'O' is pressed, Sinvanders is restarted and next info file (in alphabethical order) is loaded.
The info has format like file:
Customisation
X,ID,DATA<,PARAMLIST>;
Animations are defined e.g.
i,enemy1,enemy1,15,4
then the first 'enemy1' defines identifier that is referred from source code. The Second 'enemy1' refers to image files - image, its mask, and possibly small variants of images - here in example the actual files are named like: enemy1.bmp, enemy1_mask.bmp, enemy1_small.bmp and enemy1_mask_small.bmp. Here '15' tells that animation run every 15th game-cycles, that is 18ms. So framerate is 3.7. '4' here defines that there are frames in bitmap image.
Images are Windows bitmaps graphics (.bmp) and audio files are Windows audio files (.wav). Bitmaps are convereted to screen native format. Masks are 8 bit grayscale bitmaps. Small versions are used when screen is inited to less dimensions less than 320 pixels, small versions are not mandatory. Animations are bitmaps images where frames are stored vertically. For example if there are 4 frames in the image, and bmp dimensions are 48 x 128 pixels, then one animated graphics dimensions are 48 x 32 pixels.
Audio files are restricted to signed, 16-bit, 22050Hz Mono.
See sinvander_info.txt about examples.
Download
sInvanders source code and some product spesific build environment codes. Makefiles for each would be ideal - but I used also xCode, Visual Express C++ 2008 and Carbide toolchains.