Bowls
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
Game Class Reference

the Game object where all of the functions of the game is stored. More...

#include <Game.h>

Collaboration diagram for Game:
Collaboration graph

Public Member Functions

 Game (bool, TrackingPoint)
 
 ~Game ()
 
void update (float dt, cgg::MayaCamera &g_camera)
 
void loadWorld ()
 
void render (gl::Primitives *)
 
void startGame ()
 

Private Member Functions

void playerTurnStart ()
 
char getClosestBallType ()
 
void resetPositions (cgg::MayaCamera &g_camera)
 
void ballWallCollisionTests (Ball *, float)
 
void gameOver ()
 
void displayScore ()
 
int randomNumber (int minimum, int maximum)
 

Private Attributes

int stage = 0
 
float lockedZ = 0.0f
 the current cue stage More...
 
float lockedX = 0.0f
 the z position to be used with input maths More...
 
std::vector< Bowl * > redBowls
 the x position to be used with input maths More...
 
std::vector< Bowl * > blueBowls
 
std::vector< Ball * > scoreDisplay
 
Boxcues [2]
 
BallcueHat [2]
 
Jackjack
 
PlayerName currentTurn
 
Ballhand
 
Boxground
 
BoxendWall
 
BoxsideWall1
 
BoxsideWall2
 
KinectInputkinectSensor
 kinect data More...
 
int blueScore
 scores More...
 
int redScore
 
const cgg::Vec3 redColour = { 1, 0, 0 }
 colours More...
 
const cgg::Vec3 blueColour = { 0, 0, 1 }
 
const cgg::Vec3 yellowColour = { 1, 1, 0 }
 
const cgg::Vec3 greenColour = { 0, 1, 0 }
 
const cgg::Vec3 whiteColour = { 1, 1, 1 }
 
const float aimStage = 10.0f
 constants More...
 
const float pullBackStage = 5.0f
 
const float throwStage = 10.0f
 
const float autoThrowTime = 10.0f
 
const float delayBeforeNextTurn = 10.0f
 
const float bowlRadius = 0.4
 
const float jackRadius = 0.3
 
float handOffset = -1.7f
 the offset between the ball in hand and the floor, initially the jack More...
 

Detailed Description

the Game object where all of the functions of the game is stored.

Definition at line 21 of file Game.h.

Constructor & Destructor Documentation

Game::Game ( bool  ,
TrackingPoint   
)

constructor

Parameters
boolsitmode, if the Kinect sensor should look for sitting skeletons, if not its a standing skeleton
TrackingPointwhich hand the Kinect should track.
Game::~Game ( )

destructor

Member Function Documentation

void Game::ballWallCollisionTests ( Ball ,
float   
)
private

Runs the tests for the ball wall collisions

Parameters
Ball*a pointer to the ball to test
floatthe deltaTime
void Game::displayScore ( )
private

Displays the score in the form of the score coloured balls on the side of the screen

void Game::gameOver ( )
private

The processes that needs to happen at end of the game

char Game::getClosestBallType ( )
private

Looks for the closest ball to the jack and returns its type as a R or B

Returns
char the type of the ball
void Game::loadWorld ( )

Accessed in the load assets in main and loads the initial data for the game.

void Game::playerTurnStart ( )
private

The processes that needs to happen at the start of the turn

int Game::randomNumber ( int  minimum,
int  maximum 
)
inlineprivate

Generates a random number between 2 values

Parameters
intthe minimum value
intthe maximum value

Definition at line 149 of file Game.h.

void Game::render ( gl::Primitives *  )

This is where all of the entities are rendered. This is accessed by the update function in main.

Parameters
gl::Primitives*a pointer to the primitives
void Game::resetPositions ( cgg::MayaCamera &  g_camera)
private

Resets the positions of things such as the camera every turn

Parameters
cgg::MayaCameraa refernce to the camera
void Game::startGame ( )

initialises the game

void Game::update ( float  dt,
cgg::MayaCamera &  g_camera 
)

The update function that is accessed int the update function in main Updates all of the Game information

Parameters
floatthe deltaTime
cgg::MayaCameraa reference to the camera

Member Data Documentation

const float Game::aimStage = 10.0f
private

constants

Definition at line 95 of file Game.h.

const float Game::autoThrowTime = 10.0f
private

Definition at line 98 of file Game.h.

std::vector<Bowl*> Game::blueBowls
private

Definition at line 68 of file Game.h.

const cgg::Vec3 Game::blueColour = { 0, 0, 1 }
private

Definition at line 89 of file Game.h.

int Game::blueScore
private

scores

Definition at line 84 of file Game.h.

const float Game::bowlRadius = 0.4
private

Definition at line 100 of file Game.h.

Ball* Game::cueHat[2]
private

Definition at line 71 of file Game.h.

Box* Game::cues[2]
private

Definition at line 70 of file Game.h.

PlayerName Game::currentTurn
private

Definition at line 73 of file Game.h.

const float Game::delayBeforeNextTurn = 10.0f
private

Definition at line 99 of file Game.h.

Box* Game::endWall
private

Definition at line 76 of file Game.h.

const cgg::Vec3 Game::greenColour = { 0, 1, 0 }
private

Definition at line 91 of file Game.h.

Box* Game::ground
private

Definition at line 75 of file Game.h.

Ball* Game::hand
private

Definition at line 74 of file Game.h.

float Game::handOffset = -1.7f
private

the offset between the ball in hand and the floor, initially the jack

Definition at line 104 of file Game.h.

Jack* Game::jack
private

Definition at line 72 of file Game.h.

const float Game::jackRadius = 0.3
private

Definition at line 101 of file Game.h.

KinectInput* Game::kinectSensor
private

kinect data

Definition at line 81 of file Game.h.

float Game::lockedX = 0.0f
private

the z position to be used with input maths

Definition at line 64 of file Game.h.

float Game::lockedZ = 0.0f
private

the current cue stage

Definition at line 63 of file Game.h.

const float Game::pullBackStage = 5.0f
private

Definition at line 96 of file Game.h.

std::vector<Bowl*> Game::redBowls
private

the x position to be used with input maths

entities

Definition at line 67 of file Game.h.

const cgg::Vec3 Game::redColour = { 1, 0, 0 }
private

colours

Definition at line 88 of file Game.h.

int Game::redScore
private

Definition at line 85 of file Game.h.

std::vector<Ball*> Game::scoreDisplay
private

Definition at line 69 of file Game.h.

Box* Game::sideWall1
private

Definition at line 77 of file Game.h.

Box* Game::sideWall2
private

Definition at line 78 of file Game.h.

int Game::stage = 0
private

Definition at line 62 of file Game.h.

const float Game::throwStage = 10.0f
private

Definition at line 97 of file Game.h.

const cgg::Vec3 Game::whiteColour = { 1, 1, 1 }
private

Definition at line 92 of file Game.h.

const cgg::Vec3 Game::yellowColour = { 1, 1, 0 }
private

Definition at line 90 of file Game.h.


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