granatier
bomb.cpp
Go to the documentation of this file.
31 Bomb::Bomb(qreal fX, qreal fY, Arena* p_arena, int nBombID, int nDetonationCountdown) : Element(fX, fY, p_arena), m_xSpeed(0), m_ySpeed(0)
178 nextRow = m_arena->getRowFromY(m_y + yDirection * Granatier::CellSize/2); //this is needed because the bombs won't move if they are coming from the top, hit an up arrow and there is a hurdle below the arrow
196 if((bOnCenter || (xDirection * xDeltaCenter < 0 && xDirection * (m_xSpeed + xDeltaCenter) >= 0) || (yDirection * yDeltaCenter < 0 && yDirection * (m_ySpeed + yDeltaCenter) >= 0)) && m_mortarState < 0)
278 if(((bIsHurdleCurrentCell && !bMoveAwayFromCenter) || bIsHurdleNextCell) && !m_stopOnCenter && m_mortarState < 0)
void setInterval(int msec)
void mortar(int nMortarState, int nMortarRampEnd, int nMortarPeak, int nMortarGround)
Emitted when the Bomb is thrown by the mortar or by the player.
void setCellElement(const int p_row, const int p_column, Element *p_element)
Sets the Element that is on the Cell whose coordinates are given in parameters.
Definition: arena.cpp:72
Definition: granatierglobals.h:80
Bomb(qreal fX, qreal fY, Arena *p_arena, int nBombID, int nDetonationCountdown)
Creates a new Bomb instance.
Definition: bomb.cpp:31
void initDetonation(int nBombID, int nDetonationTimeout)
sets the explosion ID and detonation countdown
Definition: bomb.cpp:493
void removeCellElement(const int p_row, const int p_column, Element *p_element)
Removes the Element that is on the Cell whose coordinates are given in parameters.
Definition: arena.cpp:81
bool onCenter()
Checks the Bomb gets on a Cell center during its next movement.
Definition: bomb.cpp:407
Definition: granatierglobals.h:82
Definition: granatierglobals.h:129
Definition: granatierglobals.h:75
Definition: granatierglobals.h:91
This class describes the common characteristics and behaviour of any game Element (character or item)...
Definition: element.h:32
Definition: granatierglobals.h:94
void stop()
int getColFromX(const qreal p_x) const
Gets the column index corresponding to the given x-coordinate.
Definition: arena.cpp:154
Definition: granatierglobals.h:79
bool isWalkable(Element *p_element) const
Returns if it is possible to move into the cell or not, because of a wall, bomb, etc.
Definition: cell.cpp:30
Definition: granatierglobals.h:128
void start(int msec)
void move(qreal x, qreal y)
Moves the Bomb function of its current coordinates and speed.
Definition: bomb.cpp:310
bool isActive() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Definition: granatierglobals.h:78
Definition: granatierglobals.h:81
Definition: granatierglobals.h:73
Cell getCell(const int p_row, const int p_column) const
Gets the Cell at the given coordinates.
Definition: arena.cpp:120
int getRowFromY(const qreal p_y) const
Gets the row index corresponding to the given y-coordinate.
Definition: arena.cpp:144
void setSingleShot(bool singleShot)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:10 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:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.