• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

granatier

  • sources
  • kde-4.14
  • kdegames
  • granatier
  • src
bombitem.h
Go to the documentation of this file.
1 /*
2  * Copyright 2009 Mathias Kraus <k.hias@gmx.de>
3  * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of
8  * the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef BOMBITEM_H
20 #define BOMBITEM_H
21 
22 #include "elementitem.h"
23 
24 class Bomb;
25 class QTimer;
26 class KGameRenderer;
27 
31 class BombItem : public ElementItem
32 {
33 
34  Q_OBJECT
35 
36 protected:
37 
39  QTimer* m_pulseTimer;
40 
42  QTimer* m_explosionTimer;
43 
45  QList <int> m_listExplosionTiming;
46 
48  int m_animationCounter;
49 
51  int m_fallingAnimationCounter;
52 
54  bool m_dudBomb;
55 
56  int m_x;
57  int m_y;
58 
59 public:
60 
66  BombItem(Bomb* p_model, KGameRenderer* renderer);
67 
71  ~BombItem();
72 
78  QPainterPath shape() const;
79 
83  void pauseAnim();
84 
88  void resumeAnim();
89 
90 public slots:
91 
97  virtual void update(qreal p_x, qreal p_y);
98 
99 private slots:
103  virtual void startDetonation();
104 
108  virtual void pulse();
109 
113  virtual void updateAnimation();
114 
118  void updateMortarAnimation(int animationCounter, int nMortarRampEnd, int nMortarPeak);
119 
123  virtual void updateMortar(int nMortarState, int nMortarRampEnd, int nMortarPeak, int nMortarGround);
124 
128  virtual void fallingAnimation();
129 
130 signals:
135  void bombItemFinished(BombItem* bombItem); //explosion finished
136 
142  void animationFrameChanged(BombItem* bombItem, int nFrame);
143 };
144 
145 #endif
146 
nMortarGround
const int nMortarGround
Definition: bomb.cpp:29
BombItem
This class is the graphical representation of a Bomb.
Definition: bombitem.h:31
nMortarRampEnd
const int nMortarRampEnd
Definition: bomb.cpp:27
BombItem::m_y
int m_y
Definition: bombitem.h:57
BombItem::animationFrameChanged
void animationFrameChanged(BombItem *bombItem, int nFrame)
signals next animation frame
BombItem::update
virtual void update(qreal p_x, qreal p_y)
Updates the BombItem coordinates.
Definition: bombitem.cpp:113
BombItem::bombItemFinished
void bombItemFinished(BombItem *bombItem)
signals end of the explosion
QTimer
BombItem::m_dudBomb
bool m_dudBomb
Flag to stop the animation if the bomb is fallin in a hole or TODO: a dud bomb.
Definition: bombitem.h:54
Bomb
This class describes the common characteristics and behaviour of the bomb item.
Definition: bomb.h:30
BombItem::shape
QPainterPath shape() const
Overrides the default shape function to make it a small circle This function is used to determinate c...
Definition: bombitem.cpp:75
nMortarPeak
const int nMortarPeak
Definition: bomb.cpp:28
BombItem::BombItem
BombItem(Bomb *p_model, KGameRenderer *renderer)
Creates a new BombItem instance.
Definition: bombitem.cpp:30
ElementItem
This class is the graphical representation of a game Element.
Definition: elementitem.h:30
QList< int >
BombItem::pauseAnim
void pauseAnim()
Pauses the BombItem animation.
Definition: bombitem.cpp:87
BombItem::resumeAnim
void resumeAnim()
Resumes the BombItem animation.
Definition: bombitem.cpp:100
QPainterPath
BombItem::m_fallingAnimationCounter
int m_fallingAnimationCounter
Counter for falling animation.
Definition: bombitem.h:51
BombItem::~BombItem
~BombItem()
Deletes the BombItem instance.
Definition: bombitem.cpp:69
elementitem.h
BombItem::m_listExplosionTiming
QList< int > m_listExplosionTiming
Timing for the explosion.
Definition: bombitem.h:45
BombItem::m_explosionTimer
QTimer * m_explosionTimer
Timer used to animate explosion.
Definition: bombitem.h:42
BombItem::m_x
int m_x
Definition: bombitem.h:56
BombItem::m_animationCounter
int m_animationCounter
Counter for the animaton frames.
Definition: bombitem.h:48
BombItem::m_pulseTimer
QTimer * m_pulseTimer
Timer used to make the bomb pulse.
Definition: bombitem.h:39
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

KDE's Doxygen guidelines are available online.

granatier

Skip menu "granatier"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal