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

kapman

  • sources
  • kde-4.14
  • kdegames
  • kapman
gamescene.h
Go to the documentation of this file.
1 /*
2  * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
3  * Copyright 2007-2008 Alexandre Galinier <alex.galinier@hotmail.com>
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 GAMESCENE_H
20 #define GAMESCENE_H
21 
22 #include "game.h"
23 #include "elementitem.h"
24 #include "mazeitem.h"
25 #include "ghostitem.h"
26 #include "kapmanitem.h"
27 
28 #include <QGraphicsScene>
29 #include <QList>
30 #include <QSvgRenderer>
31 
32 #define USE_UNSTABLE_LIBKDEGAMESPRIVATE_API
33 #include <libkdegamesprivate/kgametheme.h>
34 
38 class GameScene : public QGraphicsScene {
39 
40  Q_OBJECT
41 
42  private:
43 
45  Game* m_game;
46 
48  KapmanItem* m_kapmanItem;
49 
51  MazeItem* m_mazeItem;
52 
54  QList<GhostItem*> m_ghostItems;
55 
57  ElementItem*** m_elementItems;
58 
60  ElementItem* m_bonusItem;
61 
63  QList<QGraphicsTextItem*> m_wonPointsLabels;
64 
66  QGraphicsTextItem* m_introLabel;
67  QGraphicsTextItem* m_introLabel2;
68  QGraphicsTextItem* m_newLevelLabel;
69  QGraphicsTextItem* m_pauseLabel;
70 
72  QSvgRenderer* m_renderer;
73 
75  KGameTheme* m_theme;
76 
77  public:
78 
83  GameScene(Game* p_game);
84 
88  ~GameScene();
89 
93  Game* getGame() const;
94 
98  void loadTheme();
99 
100  private slots:
101 
106  void intro(const bool p_newLevel);
107 
111  void start();
112 
118  void setPaused(const bool p_pause, const bool p_fromUser);
119 
126  void hideElement(const qreal p_x, const qreal p_y);
127 
131  void displayBonus();
132 
136  void hideBonus();
137 
144  void displayPoints(long p_wonPoints, qreal p_xPos, qreal p_yPos);
145 
149  void hidePoints();
150 
154  void updateSvgIds();
155 
159  void updateThemeProperties();
160 };
161 
162 #endif
163 
QGraphicsScene
mazeitem.h
KapmanItem
This class manage the display of the Kapman.
Definition: kapmanitem.h:29
QSvgRenderer
GameScene::loadTheme
void loadTheme()
Loads the game theme.
Definition: gamescene.cpp:158
GameScene::~GameScene
~GameScene()
Deletes the Game instance.
Definition: gamescene.cpp:130
game.h
Game
This class manages the game main loop : it regularly checks the key press events, computes the charac...
Definition: game.h:35
QGraphicsTextItem
ElementItem
This class is the graphical representation of a game Element.
Definition: elementitem.h:28
QList< GhostItem * >
GameScene::getGame
Game * getGame() const
Definition: gamescene.cpp:154
kapmanitem.h
elementitem.h
ghostitem.h
GameScene
This class contains all the Game elements to be drawn on the screen by the GameView instance...
Definition: gamescene.h:38
GameScene::GameScene
GameScene(Game *p_game)
Creates a new GameScene instance.
Definition: gamescene.cpp:26
MazeItem
This class is the graphical view of the Maze.
Definition: mazeitem.h:27
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

KDE's Doxygen guidelines are available online.

kapman

Skip menu "kapman"
  • Main Page
  • 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