1 /***************************************************************************
2 local_game.h - description
5 copyright : (C) 2001 by Michael Speck
6 email : kulkanie@gmx.net
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
18 /* in game client states */
21 CS_RECV_LEVEL
, /* wait for level data from server */
22 CS_SCORE_TABLE
, /* score table in local game */
23 CS_FINAL_TABLE
, /* final score table in local game */
24 CS_FINAL_PLAYER_INFO
, /* info that player cleared all levels */
25 CS_RECV_STATS
, /* wait for server to send stats */
26 CS_FINAL_STATS
, /* looking at final network player stats */
27 CS_GET_READY
, /* await click from user */
28 CS_PLAY
, /* render frame */
29 CS_NEXT_PLAYER
, /* cycle to next player in local game */
30 CS_NEXT_LEVEL
, /* init next level for player in local game */
31 CS_RESTART_LEVEL
, /* player begins at reset level next time */
32 CS_LOOSE_LIFE
, /* take a snapshot and decrease lives */
33 CS_ROUND_RESULT
,/* await click and start level receive after it */
34 CS_GAME_OVER
, /* all levels are played */
39 CS_FATAL_ERROR
, /* display error and quit game after it */
41 CS_BONUS_LEVEL_SCORE
, /* show score gained in bonus level */
42 CS_GET_READY_FOR_NEXT_LEVEL
/* wait for click when showing score of bonus level */
45 /* create various resources like shrapnells */
46 void client_game_create();
47 void client_game_delete();
49 /* create network/local game context and initiate game state:
50 * network needs to receive the level data and a local game
51 * has to load the next level */
52 int client_game_init_local( const char *setname
);
53 int client_game_init_network( char *opponent_name
, int diff
);
55 /* create local game context and initiate game state
56 * as given from slot 'slot_id'. */
57 int client_game_resume_local( int slot_id
);
59 /* finalize a game and free anything allocated by init process */
60 void client_game_finalize();
62 /* run the state driven loop until game is broken up or finished */
63 void client_game_run( void );
65 /* test a level until all balls got lost */
66 void client_game_test_level( Level
*level
);