*******
 MARS
*******

(c) 2003 by Martijn van Iersel
e-mail: amarillion@yahoo.com
website: http://www.student.wau.nl/~martijni

This is my entry for TINS 2003.
http://www.student.wau.nl/~martijni/tins/

TINS is a crazy coding competition in which entrants must write a computer 
game from scratch in 72 hours. 

There are some extra rules that were announced just before the competition 
started.

*****
rules
*****

These were the additional requirements for the competition. Each rule is followed
by an explanation of how I think I satisfy that rule:

1. Your game must have a "planet Mars" theme. This can be anything from a tetris 
   clone with a picture of Mars in the background to a real time strategy taking 
   place on the surface of the red planet. Other than that, the game genre is free. 
   You may create any type of game you like (puzzle, shooter, adventure, rpg, etc.).
   
The player is green man with eyes on stalks, and the background is quite reddish. It is
pretty safe to assume the game is set on the planet mars.

2. You may not use a rectangular grid (i.e. tilemap). Other map shapes or cell shapes 
   are ok (e.g. triangular, hexagonal, ...). You also may choose not to use any grid at 
   all, but in that case it must be very clear that you are not using a grid, so in that 
   case your choice of game type is very limited.
   
I'm not using any tilemaps at all. The level is generated with an event / trigger system.
To abolish all rectangles whatsoever, I wanted to implement pixel perfect collission detection 
but I had to scrap that bit in the last minute.
   
3. Your game must have a real GUI, something with dialogs and buttons. You may use the 
   allegro built-in dialog functions, some allegro add-on such as those you can find 
   here on allegro.cc, or you may whip up one of your own. It is up to you how prominent 
   the GUI is featured, be it only in the main menu or throughout the game.
   
The menu is a GUI with buttons that can be controlled with the mouse and with the keyboard.
I wasted a lot of time on implementing my own GUI system, but the allegro GUI is so bad
that I simply had to.

4. Feature chemical formulas, e.g. H20 or C2H5OH (alcohol). You may use them as functional 
   elements in your game, or just as background because they look cool.
   
Your weapon is a molecule gun. You can shoot 5 different particles: Helium, Oxygen, Water,
Ammonia and Methane.
   
5. Your game must feature a jelly (or jello if you're American? The stuff that comes 
   as blocks of rubbery gel which you disolve in hot water then put into the fridge to 
   set) like substance.
   
Most of the enemies are hand-drawn jellies in all colours of the rainbow.


**************
how to compile
**************

Depending on your platform, enter the following commands:

- unix / linux:

./fix.sh linux
make
./mars

- windows (mingw)

fix mingw32
make
marsw

- dos (djgpp)

fix djgpp
make
mars

then run make and everything should compile by itself. 

NOTE: I have no idea how this game behaves on slower computers. 
If the game is running too slow, try turning the music quality down in the options
menu as the music is generated by emulation of the SNES music chip, which is quite
slow. You can also try the -nosound command line option.

***********
how to play
***********

When the game starts you see a menu with three options: start, options and quit. Select
an option with the mouse or by pressing up/down and then space. options leads to the options
menu, where you can change some options regarding sound fx and music. You can turn sound off 
altogether, or you can turn just the music off. You can also choose between mono and stereo sound,
and between a 44 kHz (high quality) and 22 kHz (low quality) sampling rate.

The gameplay is simple: shoot the enemies before they kill you. Press space to shoot, use
the cursor keys to move yourself around the screen. The enemies are jellies or
rocks in various shapes and sizes. If you kill an enemy, they sometimes leave a yellow powerup.
If you collect 6 of those your weapon will be upgraded.

If you press esc during the game you'll return to the menu. If you press start again, you resume
the game exactly at the spot where you left off.

Have Fun!

********************
command line options
********************

you can use the following command line options:

-nosound : turn sound off
-windowed : run in windowed mode 
-showfps : show the framerate in the top left corner.
-fullscreen : run in fullscreen mode (default)
-doublesize : when in windowed mode, create a double sized window.
-normalsize : when windowed, have a normal sized window (default)

**********
References
**********

The music is ripped from the SNES game Megaman X. 

Some basic parts are originally from my speedhack 2003 entry "Fractal", especially
main.cpp, anim.cpp, engine.cpp, resources.cpp and object.cpp share a lot of code with Fractal, 
although they have been heavily modified.

The entry includes my alspc lib, which I published about a month ago, and which is
used to play the SNES music.

All the gfx are either generated in-game or drawn by hand by myself.

I want to thank Johan Peitz from Free Lunch Design for the game "Alex the allegator 4", and in particular for 
publishing the source code for that game. If you are familiar with it then perhaps you'll notice that this game is
very similar to the unlockable bonus stage in Alex 4, and this is no coincedence. Although I didn't copy
anything from it (not even a single line), I have used the Alex 4 source for my inspiration many times.

**********************
unimplemented features
**********************

I had some more features planned that had to go in the end:

- hiscore list
- more complex movements
- semi-transparant jellies
- pixel perfect collission detection