MainGame Class Reference

Central game object from which the players and other properties can be accessed. More...

List of all members.

Public Types

enum  GameState { Preview, Countdown, Race, Finish }
 

Current state of the game.

More...

Public Member Functions

void Awake ()
 Validates the game state at startup.
void Update ()
 Called each frame to sort racers.
void OnApplicationQuit ()
 Called on exit.
void RegisterPlayer (Competitor competitor)
 Registers a player competitor.
void Restart ()
 Resets the game.
void ExitToMenu ()
 Exits to the main menu.
bool IsOutOfBounds (float x, float y)
 Returns true if the specified location is outside the track boundary.
void FadeCamera (int index, float opacity)
 Fades the specified player camera.
void OnPauseChanged ()
 Pause state property change.
void OnGameStateChanged (GameState oldState)
 Game state property change.

Public Attributes

Checkpoint startFinishCheckpoint
 The first (and last) checkpoint.
GameObject playerCameraPrefab
 The prefab used to load player chasing cameras.
Camera levelCamera
 The main level preview camera.
Rect mapBounds
 The bounds that correspond to both the map image and the out of bounds mask image.
Texture2D mapMask
 Greyscale texture mask: white for track, black for out of bounds, grey for areas that should give out-of-bounds if in for too long.
AudioSource music
 Main game music.
Competitor[] players = new Competitor[0]
 Players.
RaceStatistics[] statistics = new RaceStatistics[0]
 Statistics.
CameraController[] cameras = new CameraController[0]
 Player cameras.
float[] cameraOpacities = new float[0]
 Player camera opacities for fading.

Properties

static readonly MainGame instance [get]
 The single instance.
GameState gameState [get, set]
 The current state of the game.
bool paused [get, set]
 Whether the game is paused.

Detailed Description

Central game object from which the players and other properties can be accessed.


Member Enumeration Documentation

Current state of the game.


Member Function Documentation

void MainGame.Awake (  ) 

Validates the game state at startup.

void MainGame.ExitToMenu (  ) 

Exits to the main menu.

void MainGame.FadeCamera ( int  index,
float  opacity 
)

Fades the specified player camera.

bool MainGame.IsOutOfBounds ( float  x,
float  y 
)

Returns true if the specified location is outside the track boundary.

void MainGame.OnApplicationQuit (  ) 

Called on exit.

void MainGame.OnGameStateChanged ( GameState  oldState  ) 

Game state property change.

void MainGame.OnPauseChanged (  ) 

Pause state property change.

void MainGame.RegisterPlayer ( Competitor  competitor  ) 

Registers a player competitor.

void MainGame.Restart (  ) 

Resets the game.

void MainGame.Update (  ) 

Called each frame to sort racers.


Member Data Documentation

float [] MainGame.cameraOpacities = new float[0]

Player camera opacities for fading.

Player cameras.

The main level preview camera.

The bounds that correspond to both the map image and the out of bounds mask image.

Texture2D MainGame.mapMask

Greyscale texture mask: white for track, black for out of bounds, grey for areas that should give out-of-bounds if in for too long.

AudioSource MainGame.music

Main game music.

The prefab used to load player chasing cameras.

Players.

The first (and last) checkpoint.

Statistics.


Property Documentation

GameState MainGame.gameState [get, set]

The current state of the game.

readonly MainGame MainGame.instance [static, get]

The single instance.

bool MainGame.paused [get, set]

Whether the game is paused.


The documentation for this class was generated from the following file:

Generated on Fri Aug 21 09:09:58 2009 for Hamlington Underground Racing Association by  doxygen 1.6.0