#include <catrophy.h>
Inheritance diagram for CATrophy:

Public Types | |
| enum | Difficulty { Easy, Medium, Hard } |
Public Member Functions | |
| virtual int | main (int argc, char **argv) |
| The main function. | |
| virtual char * | get_title () |
| Gets the application title. | |
| virtual void | init_modules () |
| Inits modules. | |
| virtual void | deinit_modules () |
| Deinits modules. | |
| void | initCarTypes () |
| Initializes car types. | |
| void | deinitCarTypes () |
| Deinitializes car types. | |
| void | initGoodies () |
| Initializes goody types and instances. | |
| void | deinitGoodies () |
| Deinitializes goody instances. | |
| void | initPlayers () |
| Initializes the players. | |
| void | deinitPlayers () |
| Deinitializes and deletes the players. | |
| void | initNetwork () |
| void | deinitNetwork () |
| void | initPanel () |
| Initializes the panel on the left. | |
| void | deinitPanel () |
| Deinitializes the panel on the left. | |
| void | initTrackList () |
| Initializes the track list. | |
| void | initTrack (CL_String trackName) |
| Initializes track with given name. | |
| void | deinitTrack () |
| Deinitializes and deletes current track. | |
| void | reconfigure () |
| Reconfigures parameters. | |
| void | resetGoodies () |
| Resets all goodies. | |
| void | resetFogBombs () |
| Resets all fog bombs. | |
| void | resetDustClowds () |
| Resets all dust clowds. | |
| void | resetPlayers () |
| Resets all players. | |
| void | runMenu () |
| Called by CATrophy::main() to start the menu in an std::endless loop. | |
| bool | runPositionTable (bool race) |
| Called by CATrophy::runMenu() to start the position table in an std::endless loop. | |
| void | runCreditsScreen () |
| Called by CATrophy::runMenu() to start the credits screen in an std::endless loop. | |
| void | runServerInfo (bool success) |
| Called by CATrophy::runMenu() to start the server info screen in an std::endless loop. | |
| void | runClientInfo (bool success) |
| Starts the client info screen in an endless loop. | |
| void | startNewGame () |
| Starts a new game. | |
| void | startServer () |
| void | chooseNetGame () |
| int | addNetPlayer () |
| void | controlNetPlayer (int id, int xpos, int ypos, int dir) |
| Controls the net player with given id. | |
| int | run () |
| Called by CATrophy::runMenu() to start the game in an std::endless loop. | |
| void | placeGoody () |
| Places a new goody (not always successful). | |
| void | setRanks () |
| Sets the ranks of the players during race. | |
| int | getSpeedLimit (int x, int y) |
| Gets the speed limit for a coordinate of the map. | |
| int | getLapPart (int x, int y) |
| Gets the lap part for a coordinate of the map. | |
| int | getLevel (int x, int y) |
| Gets the level for a coordinate of the map. | |
| bool | checkCoordinate (int x, int y) |
| Checks if the gifen coordinate is on the map and returns true if so. | |
| int | getTime () |
| Returns race time in msec. | |
| char * | getTimeString () |
| Race time as string. | |
| void | dropFogBomb (int x, int y, bool up) |
| Drops a fog bomb on the given place. | |
| void | makeDustClowd (int x, int y, bool up) |
| Created a dust clowd on the given place. | |
| void | measureFrameTime (bool start) |
| Measures the time we needed to draw a frame. | |
| void | waitForSilence () |
| Waits until no key is pressed. | |
| void | buyCars () |
| Distributes cars to players which have enough money. | |
| void | buildScreen () |
| Builds the whole game screen. | |
| void | displayMap () |
| Displays the race map. | |
| void | displayPlayers (bool up) |
| Displays players. | |
| void | displayGoodies (bool up) |
| Displays the goodies. | |
| void | displayBridge () |
| Displays the bridge if there is any. | |
| void | displayFogBombs (bool up, bool bomb) |
| Displays fog bombs. | |
| void | displayDustClowds (bool up) |
| Displays dust clowds. | |
| void | displayCheckFlag () |
| Displays a waving check flag when the first player has reached the finish. | |
| void | displayStartingLights () |
| Displays the starting light animation. | |
| void | displayTrackPoints () |
| Displays track points. | |
| void | fadeScreen (bool in, CAScreen *screen, bool whole=true) |
| Fades the screen in (true) or out (false). | |
| void | scroll () |
| Scrolls the map to center player 0. | |
| void | saveGame () |
| void | loadGame () |
Public Attributes | |
| CALoadingScreen | loading |
| Loading screen. | |
| bool | pause |
| Game paused? | |
| bool | sound |
| Sound on/off. | |
| int | volume |
| Sound volume. | |
| bool | fullScreen |
| Fullscreen mode? | |
| bool | fast |
| Fast mode (no screen fading) (command line argument --fast). | |
| bool | server |
| Are we a server (command line argument --server). | |
| bool | client |
| Are we a client (command line argument --client). | |
| bool | debug |
| Debug mode (command line argument --debug). | |
| bool | trackInfo |
| Show trackinfo (crosses and numbers on track points) (command line argument --trackinfo). | |
| float | framesPerSec |
| Frames per second we can do at maximum. | |
| CAPlayer * | player [CA_MAXPLAYERS] |
| Array of Players. Created and destroed by this class. | |
| CACarType | carType [CA_NUMCARTYPES] |
| Array of car types. | |
| CAGoodyType | goodyType [CA_NUMGOODYTYPES] |
| Array of goodyTypes. | |
| CAGoody * | goody [CA_NUMGOODYTYPES][CA_NUMGOODIES] |
| The goody instances. CA_NUMGOODIES of each type. | |
| Difficulty | difficulty |
| Chosen difficulty (easy, medium, hard). | |
| CATrack | track |
| Current track data. | |
| CAStringList | trackList |
| Track directory names list. | |
| int | offsetX |
| Offset of the background map in x. | |
| int | offsetY |
| Offset of the background map in y. | |
| CAPanel * | panel |
| Panel. Created and destroyed in this class. | |
| int | panelWidth |
| Width of panel (can change). | |
| int | headerHeight |
| Height of header in pixels. | |
| int | lightState |
| State of the start lights 0: off 1: 1/3 on 2: 2/3 on 3: on 4: sliding away. | |
| bool | firstPlayerFinished |
| first player has finished race | |
| bool | allowShooting |
| In the beginning of each race, shooting is disabled. | |
| CAFogBomb | fogBomb [CA_MAXFOGBOMBS] |
| Array of fog bombs. | |
| int | fogBombCounter |
| current index for the fogBomb array. | |
| CADustClowd | dustClowd [CA_MAXDUSTCLOWDS] |
| Array of dust clowds. | |
| int | dustClowdCounter |
| current index for the dust Clowd array. | |
| int | width |
| Total width (screen resolution in x). | |
| int | height |
| Total height (screen resolution in y). | |
| char | serverIp [16] |
| Ip set in the net options dialog or "auto". | |
| int | serverPort |
| Server port number. | |
There's only one global instance: 'CATrophy application'. It's usually accessed over the macro CA_APP. E.g.: CA_APP->buildScreen(); This class starts the Game, inits the moduls and displays things.
|
|
Builds the whole game screen. ONLY this function is called for this purpose. Implements CAScreen. |
|
||||||||||||||||||||
|
Controls the net player with given id.
|
|
|
Deinits modules. Called by ClanLib main(). |
|
|
Displays dust clowds.
|
|
||||||||||||
|
Displays fog bombs.
|
|
|
Displays players.
|
|
||||||||||||||||
|
Drops a fog bomb on the given place. This function is called from evil players. |
|
||||||||||||||||
|
Fades the screen in (true) or out (false).
|
|
|
Gets the application title. Needed by ClanLib. |
|
||||||||||||
|
Gets the level for a coordinate of the map.
|
|
|
Inits modules. Called by ClanLib main(). |
|
|
Initializes the players. As default, player[0] is human and the others are computer players. As soon as a network player joins, a computer player gets replaced by a net player. |
|
|
Initializes the track list. Track names are read fro the track directory (resources/tracks/...) |
|
||||||||||||
|
The main function. Called by ClanLib main(). |
|
||||||||||||||||
|
Created a dust clowd on the given place. This function is called from sliding players. |
|
|
Measures the time we needed to draw a frame. Used for calculating the frame rate. |
|
|
Reconfigures parameters. Called by the configure menu. |
|
|
Resets all dust clowds. This happens before a new race. |
|
|
Resets all fog bombs. This happens before a new race. |
|
|
Resets all goodies. Done before a new race. |
|
|
Resets all players. Happens before a new game (car types, points, money). |
|
|
Starts the client info screen in an endless loop.
|
|
|
Called by CATrophy::runMenu() to start the position table in an std::endless loop.
|
|
|
Called by CATrophy::runMenu() to start the server info screen in an std::endless loop.
|
|
|
Starts a new game. Called by the menu. |
1.4.4