Public Member Functions

Player Class Reference

Player class. More...

#include <Player.h>

List of all members.

Public Member Functions

 Player (Gui *gui, Level *level, IAudio *audio, IRender *render, Camera &camera)
 Contructor.
 ~Player (void)
void loadCannonball (IPhysic *physic)
 Loads geometry and texture data of the cannonball.
void loadBallLabels ()
 Loads labels to indicate a cannon type change.
void setBallType (int ballType)
 Sets a specific ball type, with differant properties.
void applyForce (float3 vec)
 Applies an impuls in direction of the Vector vec.
float3 getCannonPosition ()
 Return current Position of the cannonball.
float3 getMovingCannonPosition (bool slowDown)
void restart ()
 Resets Cannonball position to starting point.
bool checkWinCondition ()
 Return true if the cannonbal is on the goal square.
void resetCannonLabels ()
 Sets Cannonball labels in the lower right corner back to invisible.
void resetOtherCannonBalls ()
 Resets Cannonball position of not selected Cannonballs.
void saveGameState (int saveSlot, float3 cameraPosition)
 Saves the current state of the game.
float3 loadGameState (int saveSlot, float3 cameraPosition)
void saveGameStatesToFiles ()
void setWinLabel (pIControl winLabel)
 Sets the win graphic for the current level.
void setGameOver (pIControl gameOver)
void setBallsLeftLabel (pIControl ballsLeft)
void explosion ()
 Stops the cannonball when it explodes.
void playExplosionSound ()
 Plays explosion sound.
bool isMoving ()
 Is the cannonball currently moving.
bool outOfBalls ()
 Is the player out of cannonballs.
bool selectedBallAvailable ()
 Checks if the currently selected ball is available.
int getSelectedBall ()
 Checks which cannonball type is currently selected.
void checkForLevelObjects ()
 Checks if ball hits level objects.
void loadNewLevel (int levelNumber)
 Loads next level based on the level number.
void resetSaveLabel ()
 Hides Load and Save labels again.
int getCurrentLevel ()
 Returns the current level.

Detailed Description

Player class.

Definition at line 18 of file Player.h.


Constructor & Destructor Documentation

Player::Player ( Gui gui,
Level level,
IAudio audio,
IRender render,
Camera camera 
)

Contructor.

Definition at line 3 of file Player.cpp.

Player::~Player ( void   ) 

Definition at line 49 of file Player.cpp.


Member Function Documentation

void Player::applyForce ( float3  vec  ) 

Applies an impuls in direction of the Vector vec.

Definition at line 201 of file Player.cpp.

void Player::checkForLevelObjects (  ) 

Checks if ball hits level objects.

Definition at line 348 of file Player.cpp.

bool Player::checkWinCondition (  ) 

Return true if the cannonbal is on the goal square.

Definition at line 254 of file Player.cpp.

void Player::explosion (  ) 

Stops the cannonball when it explodes.

Definition at line 418 of file Player.cpp.

float3 Player::getCannonPosition (  ) 

Return current Position of the cannonball.

Definition at line 225 of file Player.cpp.

int Player::getCurrentLevel (  )  [inline]

Returns the current level.

Definition at line 95 of file Player.h.

float3 Player::getMovingCannonPosition ( bool  slowDown  ) 

Definition at line 341 of file Player.cpp.

int Player::getSelectedBall (  )  [inline]

Checks which cannonball type is currently selected.

Definition at line 83 of file Player.h.

bool Player::isMoving (  ) 

Is the cannonball currently moving.

Definition at line 325 of file Player.cpp.

void Player::loadBallLabels (  ) 

Loads labels to indicate a cannon type change.

Definition at line 109 of file Player.cpp.

void Player::loadCannonball ( IPhysic physic  ) 

Loads geometry and texture data of the cannonball.

Definition at line 53 of file Player.cpp.

float3 Player::loadGameState ( int  saveSlot,
float3  cameraPosition 
)

Loads a previous state of the game Return the old camera position

Definition at line 391 of file Player.cpp.

void Player::loadNewLevel ( int  levelNumber  ) 

Loads next level based on the level number.

Definition at line 281 of file Player.cpp.

bool Player::outOfBalls (  ) 

Is the player out of cannonballs.

Definition at line 369 of file Player.cpp.

void Player::playExplosionSound (  ) 

Plays explosion sound.

Definition at line 194 of file Player.cpp.

void Player::resetCannonLabels (  ) 

Sets Cannonball labels in the lower right corner back to invisible.

Definition at line 185 of file Player.cpp.

void Player::resetOtherCannonBalls (  ) 

Resets Cannonball position of not selected Cannonballs.

Definition at line 360 of file Player.cpp.

void Player::resetSaveLabel (  )  [inline]

Hides Load and Save labels again.

Definition at line 92 of file Player.h.

void Player::restart (  ) 

Resets Cannonball position to starting point.

Definition at line 241 of file Player.cpp.

void Player::saveGameState ( int  saveSlot,
float3  cameraPosition 
)

Saves the current state of the game.

Definition at line 378 of file Player.cpp.

void Player::saveGameStatesToFiles (  ) 

Definition at line 411 of file Player.cpp.

bool Player::selectedBallAvailable (  )  [inline]

Checks if the currently selected ball is available.

Definition at line 80 of file Player.h.

void Player::setBallsLeftLabel ( pIControl  ballsLeft  ) 

Definition at line 335 of file Player.cpp.

void Player::setBallType ( int  ballType  ) 

Sets a specific ball type, with differant properties.

Definition at line 148 of file Player.cpp.

void Player::setGameOver ( pIControl  gameOver  )  [inline]

Definition at line 64 of file Player.h.

void Player::setWinLabel ( pIControl  winLabel  )  [inline]

Sets the win graphic for the current level.

Definition at line 63 of file Player.h.


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