kapman
ghost.cpp
Go to the documentation of this file.
29 Ghost::Ghost(qreal p_x, qreal p_y, const QString & p_imageId, Maze* p_maze) : Character(p_x, p_y, p_maze) {
120 (m_ySpeed != 0 && m_ySpeed != directionsList[nb].y())) { // If the chosen direction isn't forward
139 if (curCellRow != m_maze->getResurrectionCell().y() || curCellCol != m_maze->getResurrectionCell().x()) {
QList< QPoint > getPathToGhostCamp(const int p_row, const int p_column) const
Gets the path, as a list of Cell coordinates, to go to the Ghost camp from the Cell whose coordinates...
Definition: maze.cpp:80
Cell getCell(const int p_row, const int p_column) const
Gets the Cell at the given coordinates.
Definition: maze.cpp:180
qreal m_speedIncrease
The value the character's speed is incremented by when level up.
Definition: character.h:66
Definition: ghost.h:39
This class describes the common characteristics and behaviour of the game characters (Kapman and the ...
Definition: character.h:27
void removeFirst()
Definition: element.h:39
Definition: ghost.h:38
int x() const
int y() const
int size() const
static const qreal LOW_SPEED_INC
Speed increase on easy level (percentage)
Definition: character.h:43
void setState(Ghost::State p_state)
Sets the Ghost state to the given value.
Definition: ghost.cpp:195
void append(const T &value)
bool isEmpty() const
Ghost(qreal p_x, qreal p_y, const QString &p_imageId, Maze *p_maze)
Creates a new Ghost instance.
Definition: ghost.cpp:29
Definition: ghost.h:37
void move()
Moves the Character function of its current coordinates and speed.
Definition: character.cpp:38
Definition: cell.h:38
T & first()
bool onCenter()
Checks the Character gets on a Cell center during its next movement.
Definition: character.cpp:191
Definition: cell.h:39
static const qreal MEDIUM_SPEED_INC
Speed increase on medium level (percentage)
Definition: character.h:46
qreal m_normalSpeed
Reference to the speed of the character when in "normal" behaviour.
Definition: character.h:63
void moveOnCenter()
Moves the character on the center of its current Cell.
Definition: character.cpp:222
int getRowFromY(const qreal p_y) const
Gets the row index corresponding to the given y-coordinate.
Definition: maze.cpp:199
void doActionOnCollision(Kapman *p_kapman)
Manages the collison with the Kapman.
Definition: ghost.cpp:210
int getColFromX(const qreal p_x) const
Gets the column index corresponding to the given x-coordinate.
Definition: maze.cpp:203
static const qreal HIGH_SPEED_INC
Speed increase on hard level (percentage)
Definition: character.h:49
QPoint getResurrectionCell() const
Gets the cell on witch the ghosts resurects.
Definition: maze.cpp:223
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:15 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:15 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.