Introduction News Faq Examples
Rules Entrants Entries Results

An example of how to go about in this team competition

Here is a fictive example of a plan for a tetris clone to be programmed by three people: John, Ken and Bill.

John will code the graphics, Bill will code the menu, highscores and game loop and Ken will code the game logic. In advance they have written this header file that will be included into every source file:

#include <allegro.h>
void init_graphics ();
/* this will initialize the graphics sytem written by John and load his datafiles*/
void draw (BITMAP *bmp);
/* This will be coded by John. It will be called from the main game loop written by Bill, every time the screen must be updated. The whole screen will be updated each frame, no Dirty Rectangles. Bitmap is the screen buffer /*
void close_graphics ();
/* This will clean up all memory needed for John's graphics system */

void init_game_logic ();
/* this will initialize Ken's game logic system */
void init_level ();
/* this will reset Ken's logic system to the first level */
bool update ();
/* This will be called from the main loop exactly 20 times per second, when the game is running. It will return false when the game is over, and control should return to the menu system. */
void close_game_logic ();
/* this will close down Ken's logic system */

extern int Blockmap[10][20]; 
/* block map to be initialised by ken, used by john to draw the screen */
extern int level;
extern int tetrad [7][4][4][4];
/* this is will contain a 4x4 map of the 7 tetrads in 4 turning positions. It is a constant array initialised by ken. */
exern int current_tetrad, current_tetrad_xco, current_tetrad_yco;
extern int current_tetrad_direction;
extern int next_tetrad;
extern int score;
/* all these variables are maintained by Ken's game logic code but they are used in the drawing routines of John */

This is a part of the plan they wrote:

On friday, John will start working on graphics and Ken will start on the game logic code. Bill will start on a draft of the main game loop. As soon as bill is finished with the game loop, he will send the code to John, who will start writing a draft of the drawing routine. As soon as he is ready with a very basic routine, he will send this to Ken. Now it is possible for Ken to test his game logic code. At the same time, Bill can start working on the hiscore and menu system, because he doesn't need the others for that. John can work on a more sophisticated graphic engine, with nice palette effects and background graphics. The interface of the graphic code will be exactly the same, but it will look much better.