Allegro Mini Game Collection v2.11
by Miran Amon, 29th January 2006,
last updated 21st June 2006

http://members.allegro.cc/miran
miran.amon@gmail.com
allegro.cc: #2407 (miran)

Compiling the main program:

1. You need Allegro, AllegroFont and MASkinG. You can find all on
   http://www.allegro.cc or on my page
2. Go to the "src" directory and run make. Make sure the makefile
   is actually configured for your platform first (uncomment the
   relevant include line).
3. To compile the games go to the games directory and in each
   individual game's directory run "make". Again make sure the
   makefile is properly configured. Btw, you can run "make win"
   or "make linux" so you don't need to fiddle with the makefiles.
4. If you get errors, try to fix the makefiles and/or let me know.


Instructions for developers:

To create a game simply implement the IGame interface (IGame.h) and
compile it into a .dll or .so that exports the following function:

  IGame *GetPlugin();

This function should create an instance of your game class derived
from IGame (with new) and return a pointer to it. Something like:

  IGame *GetPlugin() {
    return new MyGame;
  }

...where MyGame is a class derived from IGame.

You can use games/template/template.cpp for reference or starting
point. A makefile for MinGW and Linux is also provided. Note that
each game should reside in its own subdirectory in the games
directory.

A couple of notes:

 - Your game should assume Allegro has been initialized, the
   gfx mode set, and so on. You don't need to do any system
   initialization or anything like that.

 - The executable directory or the current working directory is the
   directory of the AMGC2 exe file, not the DLL! If your game
   loads resources from disk, make sure you use the game_path
   member of the IGame class. This means if you have a file
   named game.dat and want to load it, simply calling

      load_datafile("game.dat");

   won't work. You should at least use something like

      load_datafile("games/mygame/game.dat");

   although ideally you construct a full path, like this:

      char path[256];
      usprintf(path, game_path, "game.dat");
      load_datafile(path);

   Note that game_path is already ened with a slash/backslash. Also
   be aware of the fact that game_path is not initialized until after
   your game's class has been constructed. This means that if you need
   to load some data in the constructor, you should instead overload
   SetGamePath() method and put the code that relies of the game path
   in that method. Something like this:

      void MyGame::SetGamePath(const char *path) {
         IGame::SetGamePath(path);

         // your code goes here
      }

Change log:

v2.11:
-------
 - fixed a nasty little bug that would continuously display the high score
   dialog on game over on slower machines (and less often on faster ones)

v2.10:
-------
 - added the "Play Again" option to the game over menu so that it isn't
   necessary to go back to the back menu to play again; Note: some games
   may not work properly with this option if they don't clean up after
   themselves properly when the game is over!
 - added options to cap graphics framerate; Set the target framerate to
   a lower value to reduce CPU usage at the expense of animation smoothness.
 - bugfix: The readme.txt box would sometimes crash after changing skins.
 - bugfix: Mouse wouldn't work in a game if it chose to draw its own cursor.

v2.09:
-------
 - started adding some support for online playing (not functional yet)
 - reorganized the main menu into tabs
 - added IGame::SetGamePath() to let the games know where they are located
   so they know where to look for their data instead on having to rely on
   assumptions about the path (note: all games need to be recompiled!)
 - made the highscore dialog remember your name
 - added a readme.txt reader for the games that come with a readme.txt

v2.08:
-------
 - added some error checking at program initialization
 - fixed the bug where you'd get game over and highscore messages at
   the end of the game indefinately
 - added targetFrameRate
 - bugfix: game settings wouldn't be loaded on game start

v2.07:
-------

Stupid me, I didn't write down changes prior to v2.08.
