Qubet  1.0
The ultimate QGL addicting videogame!
 All Classes Functions Variables Pages
Signals | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
Game Class Reference

It is the Game Class. More...

#include <game.h>

Inheritance diagram for Game:
Inheritance graph
Collaboration diagram for Game:
Collaboration graph

Signals

void collision ()
 Signal emitted when the cube has a collision with an obstacle.
 
void gameClosedSignal ()
 Signal emitted to close the game.
 
void setMouseMovementTracking (int mode)
 This signal is emitted to set the Qubet's Mouse Move Tracking sensibility. The modes are: 0 - no signal emitted. 1 - the signal mouseMoved is emitted only when the mouse is moved and one of the mouse buttons are clicked. 2 - the signal mouseMoved is emitted always when the mouse is moved. More...
 
void keyPressedSignal (QKeyEvent *event)
 Signal relaunched from Qubet when the user presses a key on the keyboard. More...
 
void enableAudio (bool enabled)
 Signal emitted to enable or disable the audio. More...
 
void playAmbientMusic (QString filename)
 Signal emitted to play the ambient music. More...
 
void stopAmbientMusic ()
 Signal emitted to stop the current ambient music.
 
void playEffect (QString effectName)
 Signal emitted to play an effect. More...
 
void setSkybox (QString skyboxName)
 Signal emitted to set the Skybox. More...
 

Public Member Functions

 Game (QMap< GLint, GLuint > &_iconsList, Alphabet *_alphabet, Skin *_skin, QMap< GLint, Level * > &_levelsList, QObject *_parent=0, bool _audioEnabled=true, QGLShaderProgram *_explosionShader=NULL)
 Creator for the Story Mode. More...
 
 Game (QMap< GLint, GLuint > &_iconsList, Alphabet *_alphabet, Skin *_skin, Level *_level, QObject *_parent=0, bool _audioEnabled=true, QGLShaderProgram *_explosionShader=NULL)
 Cunstructor for the Arcade Mode. More...
 
 ~Game ()
 Safely destroy a Game Object.
 
void startGame ()
 Function to start the game.
 
void draw (GLboolean simplifyForPicking=false)
 Method to draw the game. More...
 

Private Slots

void itemClicked (QMouseEvent *event, QList< GLuint > listNames)
 Slot invoked when the user clicks on a item. More...
 
void mouseReleased (QMouseEvent *event)
 Slot invoked when the user releases the mouse button. More...
 
void mouseMoved (QMouseEvent *event, QList< GLuint > listNames)
 Slot invoked when the user moves the mouse. More...
 
void wheelScrolled (QWheelEvent *event)
 Slot invoked when the user scrolls the wheel of the mouse button. More...
 
void keyPressed (QKeyEvent *event)
 Slot invoked when the user presses a key on the keyboard. More...
 
void collided ()
 Slot invoked when the cube has a collision with an obstacle.
 
void exploded ()
 Slot invoked when the cube has exploded (suicide or collided).
 
void explosionFinished ()
 Slot invoked when the explosion has finished.
 
void levelCompleted ()
 Slot invoked when level is completed.
 
void hideLevelName ()
 Slot invoked to hide the Level Name.
 

Private Member Functions

void initGame ()
 Initialize the game.
 
void countdown ()
 make the animation for the initial countdown
 
void playLevel ()
 Start the current Level.
 
void nextLevel ()
 Go to the next level.
 
void pauseGame ()
 Pause the Game.
 
void continueGame ()
 Continue the Game from Pause mode.
 
void quitGame ()
 Quit the game and returns to Menu.
 
void createResultStrings ()
 Creates the resultsCubeString.
 

Private Attributes

QObjectparent
 
QMap< GLint, GLuint > iconsList
 
Alphabetalphabet
 
Skinskin
 
Levellevel
 
Levelnext
 
QMap< GLint, Level * > levelsList
 
bool audioEnabled
 
Cubecube
 
PositionControllerpositionController
 
GLint gameType
 
GLint currentLevel
 
GLint deaths
 
ActionListcurrentActions
 
GLfloat angleRotVolumeCube
 
SkinvolumeSkin
 
SkinasphaltSkin
 
SkingridSkin
 
Vector3fcameraOffset
 
Vector3flevelOffset
 
CubeStringstateLabel
 
CubeStringquitLabel
 
GLuint introStep
 
bool isPaused
 
bool isExploding
 
CubeStringdeathCounter
 
QGLShaderProgram * explosionShader
 
bool isQuitting
 
bool showingResult
 
CubeStringlevelName
 
CubeStringresultsCubeString
 
CubeStringadjectiveCubeString
 
GLuint waitCounter
 

Detailed Description

It is the Game Class.

Version
1.0
Author
#34

Constructor & Destructor Documentation

Game::Game ( QMap< GLint, GLuint > &  _iconsList,
Alphabet _alphabet,
Skin _skin,
QMap< GLint, Level * > &  _levelsList,
QObject _parent = 0,
bool  _audioEnabled = true,
QGLShaderProgram *  _explosionShader = NULL 
)
explicit

Creator for the Story Mode.

Parameters
_iconsListis the reference to Qubet's iconsList.
_alphabetis the reference to Qubet's alphabet.
_skinis the Skin.
_levelsListis the levelList.
_parentis a callback variable to the parent of the parent.
_audioEnabledis a variable to states if the audio is enabled or not.
_explosionShaderis the shader for the explosion.

Here is the call graph for this function:

Game::Game ( QMap< GLint, GLuint > &  _iconsList,
Alphabet _alphabet,
Skin _skin,
Level _level,
QObject _parent = 0,
bool  _audioEnabled = true,
QGLShaderProgram *  _explosionShader = NULL 
)
explicit

Cunstructor for the Arcade Mode.

Parameters
_iconsListis the reference to Qubet's iconsList.
_alphabetis the reference to Qubet's alphabet.
_skinis the Skin.
_levelis the "going to play" Level.
_parentis the Game parent.
_audioEnabledis the audioEnabled boolean value.
_explosionShaderis the shader for the explosion.

Here is the call graph for this function:

Member Function Documentation

void Game::draw ( GLboolean  simplifyForPicking = false)

Method to draw the game.

Parameters
simplifyForPicking[default = false] is used to draw a simplified scene used for the picking function.

Here is the call graph for this function:

Here is the caller graph for this function:

void Game::enableAudio ( bool  enabled)
signal

Signal emitted to enable or disable the audio.

Parameters
enabledis the variable that states if the audio is to enable or not.

Here is the caller graph for this function:

void Game::itemClicked ( QMouseEvent *  event,
QList< GLuint >  listNames 
)
privateslot

Slot invoked when the user clicks on a item.

Parameters
eventis the QMouseEvent.
listNamesis the QList<GLuint> of item's names.

Here is the call graph for this function:

void Game::keyPressed ( QKeyEvent *  event)
privateslot

Slot invoked when the user presses a key on the keyboard.

Parameters
eventis the QKeyEvent*.

Here is the call graph for this function:

void Game::keyPressedSignal ( QKeyEvent *  event)
signal

Signal relaunched from Qubet when the user presses a key on the keyboard.

Parameters
eventis the QKeyEvent*.

Here is the caller graph for this function:

void Game::mouseMoved ( QMouseEvent *  event,
QList< GLuint >  listNames 
)
privateslot

Slot invoked when the user moves the mouse.

Parameters
eventis the QMouseEvent*.
listNamesis the QList<GLuint> of item's names.

Here is the call graph for this function:

void Game::mouseReleased ( QMouseEvent *  event)
privateslot

Slot invoked when the user releases the mouse button.

Parameters
eventis the QMouseEvent*.
void Game::playAmbientMusic ( QString  filename)
signal

Signal emitted to play the ambient music.

Parameters
filenameis the filename to play.

Here is the caller graph for this function:

void Game::playEffect ( QString  effectName)
signal

Signal emitted to play an effect.

Parameters
effectNameis the name of the effect to play.

Here is the caller graph for this function:

void Game::setMouseMovementTracking ( int  mode)
signal

This signal is emitted to set the Qubet's Mouse Move Tracking sensibility. The modes are: 0 - no signal emitted. 1 - the signal mouseMoved is emitted only when the mouse is moved and one of the mouse buttons are clicked. 2 - the signal mouseMoved is emitted always when the mouse is moved.

Parameters
modeIt is the selected mode.

Here is the caller graph for this function:

void Game::setSkybox ( QString  skyboxName)
signal

Signal emitted to set the Skybox.

Parameters
skyboxNameis the name of the Skybox to apply.

Here is the caller graph for this function:

void Game::wheelScrolled ( QWheelEvent *  event)
privateslot

Slot invoked when the user scrolls the wheel of the mouse button.

Parameters
eventis the QWheelEvent*.

Member Data Documentation

CubeString* Game::adjectiveCubeString
private

It is the adjective CubeStinr.

Alphabet* Game::alphabet
private

It is the alphabet provided by Qubet.

GLfloat Game::angleRotVolumeCube
private

It is the current rotation angle of the volume icon.

Skin* Game::asphaltSkin
private

It is the asphalt Skin.

bool Game::audioEnabled
private

It is the audioEnabled boolean value.

Vector3f* Game::cameraOffset
private

It is the camera offset for the editor.

Cube* Game::cube
private

It is the cube pointer.

ActionList* Game::currentActions
private

It is the list of the current menu steps.

GLint Game::currentLevel
private

It is the current level value.

CubeString* Game::deathCounter
private

It is the Death Counter CubeString.

GLint Game::deaths
private

It is the death counter value.

QGLShaderProgram* Game::explosionShader
private

It is the explosion Shader.

GLint Game::gameType
private

It is the game type value.

Skin* Game::gridSkin
private

It is the starting grid Skin.

QMap<GLint,GLuint> Game::iconsList
private

It is the iconsList provided by Qubet object.

GLuint Game::introStep
private

It is the parameter for the introduction.

bool Game::isExploding
private

It says if the cube is exploding.

bool Game::isPaused
private

It says if the game is paused or not.

bool Game::isQuitting
private

It is the variable that states if the game is quitting.

Level* Game::level
private

It is the current level pointer.

CubeString* Game::levelName
private

It is the level name CubeString.

Vector3f* Game::levelOffset
private

It is the offset of the Level.

QMap<GLint,Level*> Game::levelsList
private

It is the story levelList.

Level* Game::next
private

It is a pointer to the next Level.

QObject* Game::parent
private

It is the parent of a game Object.

PositionController* Game::positionController
private

It is the positionController pointer.

CubeString* Game::quitLabel
private

It is the CubeString used in pause mode to back to the menu.

CubeString* Game::resultsCubeString
private

It is the CubeString for the final results.

bool Game::showingResult
private

It is the variable that states if the game is showing results.

Skin* Game::skin
private

it is the cube skin pointer.

CubeString* Game::stateLabel
private

It is the state CubeString (used for Pause string, intro, ...).

Skin* Game::volumeSkin
private

It is the skin of the volume button.

GLuint Game::waitCounter
private

It is the variable that sign the waiting time.


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