kapman
character.cpp
Go to the documentation of this file.
30 Character::Character(qreal p_x, qreal p_y, Maze* p_maze) : Element(p_x, p_y, p_maze), m_xSpeed(0), m_ySpeed(0) {
32 m_maxSpeed = m_normalSpeed; // To avoid bugs, but will be overridden in the Ghost and Kapman constructors
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
This class describes the common characteristics and behaviour of the game characters (Kapman and the ...
Definition: character.h:27
static const qreal LOW_SPEED_INC
Speed increase on easy level (percentage)
Definition: character.h:43
void move()
Moves the Character function of its current coordinates and speed.
Definition: character.cpp:38
Definition: cell.h:38
void increaseCharactersSpeed()
Increases the Character speed with each level completed.
Definition: character.cpp:100
void initSpeed()
Initializes the Character speed considering the difficulty level.
Definition: character.cpp:83
bool onCenter()
Checks the Character gets on a Cell center during its next movement.
Definition: character.cpp:191
This class describes the common characteristics and behaviour of any game Element (character or item)...
Definition: element.h:30
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
Character(qreal p_x, qreal p_y, Maze *p_maze)
Creates a new Character instance.
Definition: character.cpp:30
int getRowFromY(const qreal p_y) const
Gets the row index corresponding to the given y-coordinate.
Definition: maze.cpp:199
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
bool isInLineSight(Character *p_character)
Checks the Character is in the line of sight of the given other Character.
Definition: character.cpp:109
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.