kapman
#include <game.h>

Public Slots | |
| void | keyPressEvent (QKeyEvent *p_event) |
| void | resumeAfterKapmanDeath () |
Signals | |
| void | bonusOff () |
| void | bonusOn () |
| void | elementEaten (const qreal p_x, const qreal p_y) |
| void | gameOver (const bool p_unused) |
| void | gameStarted () |
| void | levelChanged (unsigned int p_level) |
| void | levelStarted (const bool p_newLevel) |
| void | livesChanged (unsigned int p_lives) |
| void | pauseChanged (const bool p_pause, const bool p_fromUser) |
| void | pointsToDisplay (long p_wonPoints, qreal p_xPos, qreal p_yPos) |
| void | scoreChanged (unsigned int p_score) |
Public Member Functions | |
| Game () | |
| ~Game () | |
| void | createBonus (QPointF p_position) |
| void | createGhost (QPointF p_position, const QString &p_imageId) |
| void | createKapman (QPointF p_position) |
| Bonus * | getBonus () const |
| QList< Ghost * > | getGhosts () const |
| Kapman * | getKapman () const |
| int | getLevel () const |
| int | getLives () const |
| Maze * | getMaze () const |
| int | getScore () const |
| QTimer * | getTimer () const |
| void | initGhost () |
| void | initKapman () |
| void | initMaze (const int p_nbRows, const int p_nbColumns) |
| bool | isCheater () const |
| bool | isPaused () const |
| void | pause (bool p_locked=false) |
| void | setLevel (int p_level) |
| void | setSoundsEnabled (bool p_enabled) |
| void | start () |
| void | switchPause (bool p_locked=false) |
Static Public Attributes | |
| static int | s_bonusDuration |
| static qreal | s_durationRatio |
| static int | s_preyStateDuration |
Detailed Description
This class manages the game main loop : it regularly checks the key press events, computes the character moves and updates their coordinates.
Constructor & Destructor Documentation
Member Function Documentation
|
signal |
Emitted when the Bonus has to disappear.
|
signal |
Emitted when the Bonus has to be displayed.
| void Game::createBonus | ( | QPointF | p_position | ) |
| void Game::createGhost | ( | QPointF | p_position, |
| const QString & | p_imageId | ||
| ) |
| void Game::createKapman | ( | QPointF | p_position | ) |
|
signal |
|
signal |
Emitted when the Game is over.
- Parameters
-
p_unused this parameter must always be true !
|
signal |
Emitted when the Game is started.
| QList< Ghost * > Game::getGhosts | ( | ) | const |
| int Game::getLives | ( | ) | const |
| void Game::initGhost | ( | ) |
Initializes a Ghost.
| void Game::initKapman | ( | ) |
Initializes a Kapman.
| void Game::initMaze | ( | const int | p_nbRows, |
| const int | p_nbColumns | ||
| ) |
| bool Game::isCheater | ( | ) | const |
| bool Game::isPaused | ( | ) | const |
|
slot |
|
signal |
Emitted when the level have changed.
- Parameters
-
p_level the new level data
|
signal |
Emitted when a level begins, if level up or if a life has been lost.
- Parameters
-
p_newLevel true if a new level is beginning, false otherwise
|
signal |
Emitted when the lives have changed.
- Parameters
-
p_lives the new lives data
| void Game::pause | ( | bool | p_locked = false | ) |
|
signal |
|
signal |
Emitted when a ghost or a bonus is eaten.
It tells to the scene to display the number of won points
- Parameters
-
p_wonPoints the value to display p_xPos the x position of the label p_yPos the y position of the label
|
slot |
|
signal |
Emitted when the score have changed.
- Parameters
-
p_score the new score data
| void Game::setLevel | ( | int | p_level | ) |
| void Game::setSoundsEnabled | ( | bool | p_enabled | ) |
| void Game::switchPause | ( | bool | p_locked = false | ) |
Member Data Documentation
|
static |
|
static |
|
static |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:44:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.
KDE API Reference