granatier
game.cpp
Go to the documentation of this file.
65 Player* player = new Player(qreal(Granatier::CellSize * (-0.5)),qreal(Granatier::CellSize * 0.5), strPlayerIDs[i], playerSettings, m_arena);
77 connect(m_players[i], SIGNAL(bombDropped(Player*,qreal,qreal,bool,int)), this, SLOT(createBomb(Player*,qreal,qreal,bool,int)));
103 KGlobal::dirs()->addResourceType("arenaselector", "data", KGlobal::mainComponent().componentName() + "/arenas/");
104 KGlobal::dirs()->findAllResources("arenaselector", "*.desktop", KStandardDirs::Recursive, arenasAvailable);
172 Block* block = new Block((j + 0.5) * Granatier::CellSize, (i + 0.5) * Granatier::CellSize, m_arena, "arena_block");
200 m_players[i]->setInitialCoordinates(qreal(Granatier::CellSize * playerPosition.x()), qreal(Granatier::CellSize * playerPosition.y()));
439 // At the beginning, the timer is stopped but the Game isn't paused (to allow keyPressedEvent detection)
567 if(cellType != Granatier::Cell::WALL && cellType != Granatier::Cell::HOLE && m_arena->getCell(nRow, nCol).isWalkable(0))
575 Bomb* bomb = new Bomb((nCol + 0.5) * Granatier::CellSize, (nRow + 0.5) * Granatier::CellSize, m_arena, m_bombCount, 1000); // time in ms
685 QList<Element*> bombElements = m_arena->getCell(row, col).getElements(Granatier::Element::BOMB);
705 Bomb* bomb = new Bomb((col + 0.5) * Granatier::CellSize, (row + 0.5) * Granatier::CellSize, m_arena, m_bombCount, 2500); // time in ms
void setInterval(int msec)
void clear()
static QStringList randomArenaModeArenaList()
Get List of arenas, used in random mode.
Definition: settings.h:106
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:111
Definition: granatierglobals.h:109
int length() const
Definition: granatierglobals.h:105
This class handles XML reader events in order to initialize the Arena properties. ...
Definition: mapparser.h:30
const T & at(int i) const
void removeAt(int i)
bool contains(const QString &str, Qt::CaseSensitivity cs) const
QList< Element * > getElements() const
Gets all the Elements that are on the Cell.
Definition: cell.cpp:62
iterator erase(iterator pos)
bool isAutoRepeat() const
bool exists() const
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 enabled(const QString &strPlayerID) const
Definition: playersettings.cpp:144
Definition: granatierglobals.h:107
Definition: granatierglobals.h:139
int size() const
Definition: granatierglobals.h:115
int indexOf(const T &value, int from) const
int count(const T &value) const
qreal x() const
qreal y() const
void append(const T &value)
void pauseChanged(const bool p_pause, const bool p_fromUser)
Emitted when the pause state has changed.
bool isEmpty() const
This class describes the common characteristics and behaviour of the bomb item.
Definition: bomb.h:30
typedef Iterator
Definition: granatierglobals.h:75
Definition: playersettings.h:27
void infoChanged(const Granatier::Info::Type p_info)
Emitted when something to display has changed.
Definition: granatierglobals.h:110
iterator end()
int key() const
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()
Definition: granatierglobals.h:114
void blockDestroyed(const int row, const int col, Block *block)
remove Block from list and decide to give bonus
Definition: game.cpp:739
Definition: granatierglobals.h:116
Definition: granatierglobals.h:106
void setRoundFinished()
Checks if the round has finished and set it finished.
Definition: game.cpp:637
QPointF getPlayerPosition(int p_player) const
Gets the player position on the arena.
Definition: arena.cpp:111
This class contains all the Game elements to be drawn on the screen by the GameView instance...
Definition: gamescene.h:50
int getColFromX(const qreal p_x) const
Gets the column index corresponding to the given x-coordinate.
Definition: arena.cpp:154
virtual bool parse(const QXmlInputSource &input)
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
void start(int msec)
void createBomb(Player *player, qreal x, qreal y, bool newBomb, int throwDistance)
Creates a bomb in the Cell with the coordinates x and y or throws the bomb from that possition if the...
Definition: game.cpp:679
Definition: granatierglobals.h:108
bool isActive() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Definition: granatierglobals.h:73
iterator begin()
Cell getCell(const int p_row, const int p_column) const
Gets the Cell at the given coordinates.
Definition: arena.cpp:120
static bool useWilhelmScream()
Get Whether to use the Wilhelm Scream for dying players.
Definition: settings.h:239
Definition: granatierglobals.h:112
int getRowFromY(const qreal p_y) const
Gets the row index corresponding to the given y-coordinate.
Definition: arena.cpp:144
virtual void setContentHandler(QXmlContentHandler *handler)
void setSingleShot(bool singleShot)
Definition: granatierglobals.h:76
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.