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

granatier

  • sources
  • kde-4.12
  • kdegames
  • granatier
  • src
playeritem.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 PLAYERITEM_H
20 #define PLAYERITEM_H
21 
22 #include "characteritem.h"
23 
24 class QTimeLine;
25 class Player;
26 class BonusItem;
27 class KGameRenderer;
28 
32 class PlayerItem : public CharacterItem
33 {
34  Q_OBJECT
35 
36 private:
37 
39  static const int NB_FRAMES;
40 
42  static const int ANIM_SPEED;
43 
45  QTimeLine* m_animationTimer;
46 
48  int m_fallingAnimationCounter;
49 
51  int m_resurrectionAnimationCounter;
52 
54  QString m_strPlayerId;
55 
56 public:
57 
63  PlayerItem(Player* p_model, KGameRenderer* renderer);
64 
68  ~PlayerItem();
69 
70 public slots:
71 
75  void updateDirection();
76 
77  void updateGraphics(qreal svgScaleFactor);
78 
82  void manageCollision();
83 
89  void update(qreal p_x, qreal p_y);
90 
94  void startAnim();
95 
99  void pauseAnim();
100 
104  void resumeAnim();
105 
109  void stopAnim();
110 
114  void fallingAnimation();
115 
120  void setFrame(const int p_frame);
121 
125  void setDead();
126 
130  void resurrect();
131 
132 signals:
133  void bonusItemTaken(BonusItem* bonusItem);
134 };
135 
136 #endif
137 
PlayerItem::pauseAnim
void pauseAnim()
Pauses the PlayerItem animation.
Definition: playeritem.cpp:226
PlayerItem::startAnim
void startAnim()
Starts the PlayerItem animation.
Definition: playeritem.cpp:217
PlayerItem::resumeAnim
void resumeAnim()
Resumes the PlayerItem animation.
Definition: playeritem.cpp:235
BonusItem
This class is the graphical representation of a Bonus.
Definition: bonusitem.h:30
PlayerItem::~PlayerItem
~PlayerItem()
Deletes the PlayerItem instance.
Definition: playeritem.cpp:78
PlayerItem::updateDirection
void updateDirection()
Rotates the image function of the Player direction.
Definition: playeritem.cpp:124
CharacterItem
This class is the graphical representation of a Character.
Definition: characteritem.h:30
characteritem.h
PlayerItem::PlayerItem
PlayerItem(Player *p_model, KGameRenderer *renderer)
Creates a new PlayerItem instance.
Definition: playeritem.cpp:37
PlayerItem::stopAnim
void stopAnim()
Stops the PlayerItem animation.
Definition: playeritem.cpp:244
PlayerItem::setFrame
void setFrame(const int p_frame)
Sets the given frame to the PlayerItem.
Definition: playeritem.cpp:261
PlayerItem::manageCollision
void manageCollision()
Manages the collisions with any Element.
Definition: playeritem.cpp:160
PlayerItem::resurrect
void resurrect()
resurrects the playeritem
Definition: playeritem.cpp:83
PlayerItem::updateGraphics
void updateGraphics(qreal svgScaleFactor)
Definition: playeritem.cpp:154
PlayerItem::update
void update(qreal p_x, qreal p_y)
Updates the PlayerItem coordinates.
Definition: playeritem.cpp:206
PlayerItem
This class manage the display of the Player.
Definition: playeritem.h:32
PlayerItem::fallingAnimation
void fallingAnimation()
the animation when falling in a hole
Definition: playeritem.cpp:256
PlayerItem::bonusItemTaken
void bonusItemTaken(BonusItem *bonusItem)
PlayerItem::setDead
void setDead()
Implements the CharacterItem method.
Definition: playeritem.cpp:375
Player
This class represents the main character of the game.
Definition: player.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:43:51 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