Gravity Flip
Public Slots | Signals | Public Member Functions | Public Attributes | List of all members
Game Class Reference

Inherits QGraphicsView.

Public Slots

void reincarnateSet (int)
 Regenerate the set. More...
 

Signals

void requestFlipPlayerUpdate (Player *player)
 Send a request to flip the player.
 
void requestFlipPlayerUpdateForPlayer1 (Player *player)
 Send a request to flip player 1.
 
void requestFlipPlayerUpdateForPlayer2 (Player *player)
 Send a request to flip player 2.
 

Public Member Functions

 Game (GameType type, std::vector< int > playerIDMapping, QWidget *parent=0)
 Constructor. More...
 
void keyPressEvent (QKeyEvent *event)
 Function called when Key press is detected.
 
void closeEvent (QCloseEvent *event)
 Function called when X button is pressed.
 
void startSinglePlayerGame ()
 Starts a SinglePlayer Game.
 
void startMultiPlayerGame ()
 Starts a MultiPlayer Game.
 
void connectCommonSignals ()
 Connects the signals which are common to both single and multiplayer games.
 
void connectSignalsForSinglePlayerGame ()
 Connects the signals required for singleplayer game.
 
void connectSignalsForMultiPlayerGame ()
 Connects the signals required for multiplayer game.
 

Public Attributes

QTimer * timer
 timer Used for updating the player position and score
 
QGraphicsScene * scene
 scene
 
BackgroundMusicbackgroundMusic
 Background music.
 
BackgroundUpdaterbackgroundUpdater
 Background updater Object which is called by timer to update the background.
 
NoobSetnoobSet
 Noob Set.
 
Set1set1
 Set 1.
 
Set2set2
 Set 2.
 
GameType gameType
 Type of the Game Can either be GAMETYPE::SINGLEPLAYER or GAMETYPE::MULTIPLAYER.
 
GameState gameState
 State of the Game Can either be GAMESTATE::PLAYING or GAMESTATE::PAUSED or GAMESTATE::FINISHED.
 
Playerplayer [2]
 Information regarding the player.
 
std::vector< int > playerID
 Player to character Mapping Vector representing the indices of characters chosen by the user.
 
QPixmap images [2]
 Images Image of the Player.
 
QLabel * displayImage
 Display Image Image to be displayed near the score.
 
ScoreUpdaterscoreUpdater
 Score Updater Object to store/update the score.
 
QThread * threadForPlayer1
 Thread For 1st Player Operations on the first player are performed in this thread.
 
QThread * threadForPlayer2
 Thread for 2nd Player Operations on the second player are performed in this thread.
 
RunPlayerWorkerworkerForPlayer1
 Worker Object for 1st Thread Worker Function to be executed on the 1st thread.
 
RunPlayerWorkerworkerForPlayer2
 Worker Object for 2nd Thread Worker Function to be executed on the 2nd thread.
 
QPushButton * pauseButton
 Pause Button.
 
QPushButton * resumeButton
 Resume Button.
 
int xShift
 Shift in x per 10 milli seconds.
 
int yShift
 Shift in y per 10 milli seconds.
 

Constructor & Destructor Documentation

Game::Game ( GameType  type,
std::vector< int >  playerIDMapping,
QWidget *  parent = 0 
)

Constructor.

Parameters
typeType of the game
playerIDMappingVector representing the choice of characters
parentPointer to Parent of this Widget

Member Function Documentation

void Game::reincarnateSet ( int  idx)
slot

Regenerate the set.

Parameters
Indexof the set

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