1 /* Tower Toppler - Nebulus 2 * Copyright (C) 2000-2012 Andreas R�ver 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 */ 18 19 #ifndef GAME_H 20 #define GAME_H 21 22 #include <SDL_types.h> 23 24 /* return values of towergame */ 25 typedef enum { 26 GAME_FINISHED, // the tower has been finished successfully 27 GAME_DIED, // the toppler died 28 GAME_ABORTED // the game was aborted (ESC) 29 } gam_result; 30 31 /* load data */ 32 void gam_init(void); 33 34 /* free data */ 35 void gam_done(void); 36 37 /* initialize a completely new game, points to zero, ... */ 38 void gam_newgame(void); 39 40 /* initializes the tower specific data structures */ 41 void gam_loadtower(Uint8 tow); 42 43 /* leave toppler at the base of the tower */ 44 void gam_arrival(void); 45 46 /* plays the towergame. 47 if demo is > 0, then demo == demo length, shows demo, 48 getting keys from demobuf. 49 if demo == -1, then records a demo, and returns the demo length 50 in demo, and the allocated buffer in demobuf. 51 if demo == -2, then a testplay is done, just like demo recording, but 52 without the recording 53 if demo == 0, normal game 54 */ 55 gam_result gam_towergame(Uint8 &anglepos, Uint16 &resttime, int &demo, void *demobuf); 56 57 /* pick up the toppler at the base of the tower */ 58 void gam_pick_up(Uint8 anglepos, Uint16 time); 59 60 #endif 61