• 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
kapman.h
Go to the documentation of this file.
1 /*
2  * Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef KAPMAN_H
19 #define KAPMAN_H
20 
21 #include "character.h"
22 
26 class Kapman : public Character {
27 
28  Q_OBJECT
29 
30  private:
31 
33  static const qreal MAX_SPEED_RATIO;
34 
36  qreal m_askedXSpeed, m_askedYSpeed;
37 
38  public:
39 
46  Kapman(qreal p_x, qreal p_y, Maze* p_maze);
47 
51  ~Kapman();
52 
56  void init();
57 
61  void goUp();
62 
66  void goDown();
67 
71  void goRight();
72 
76  void goLeft();
77 
81  void updateMove();
82 
86  qreal getAskedXSpeed() const;
87 
91  qreal getAskedYSpeed() const;
92 
97  void winPoints(Element* p_element);
98 
102  void die();
103 
107  void emitGameUpdated();
108 
112  void initSpeedInc();
113 
114  private:
115 
119  void updateDirection();
120 
124  Cell getAskedNextCell();
125 
129  void stopMoving();
130 
131  signals:
132 
136  void directionChanged();
137 
142  void sWinPoints(Element* p_element);
143 
147  void gameUpdated();
148 
152  void stopped();
153 };
154 
155 #endif
character.h
Kapman::goDown
void goDown()
Makes the Kapman ask to go down.
Definition: kapman.cpp:46
Cell
This class represents a Cell of the Maze.
Definition: cell.h:28
Kapman::goRight
void goRight()
Makes the Kapman ask to go to the right.
Definition: kapman.cpp:51
Kapman::goUp
void goUp()
Makes the Kapman ask to go up.
Definition: kapman.cpp:41
Kapman::winPoints
void winPoints(Element *p_element)
Manages the points won.
Definition: kapman.cpp:135
Character
This class describes the common characteristics and behaviour of the game characters (Kapman and the ...
Definition: character.h:27
Kapman::~Kapman
~Kapman()
Deletes the Kapman instance.
Definition: kapman.cpp:30
Kapman::init
void init()
Initializes the Kapman.
Definition: kapman.cpp:34
Kapman::directionChanged
void directionChanged()
Emitted when the direction changed.
Kapman::getAskedYSpeed
qreal getAskedYSpeed() const
Definition: kapman.cpp:152
Kapman::stopped
void stopped()
Emitted when the kapman stops moving.
Kapman::Kapman
Kapman(qreal p_x, qreal p_y, Maze *p_maze)
Creates a new Kapman instance.
Definition: kapman.cpp:25
Element
This class describes the common characteristics and behaviour of any game Element (character or item)...
Definition: element.h:30
Kapman::initSpeedInc
void initSpeedInc()
Initializes the Kapman speed from the Character speed.
Definition: kapman.cpp:184
Kapman::die
void die()
Implements the Character function.
Definition: kapman.cpp:140
Kapman::gameUpdated
void gameUpdated()
Signals to Kapmanitem that the game has been updated.
Kapman::sWinPoints
void sWinPoints(Element *p_element)
Signals to the game that the kapman win points.
Kapman::updateMove
void updateMove()
Updates the Kapman move.
Definition: kapman.cpp:70
Kapman::goLeft
void goLeft()
Makes the Kapman ask to go to the left.
Definition: kapman.cpp:56
Kapman
This class represents the main character of the game.
Definition: kapman.h:26
Kapman::emitGameUpdated
void emitGameUpdated()
Emits a signal to Kapmanitem in order to manage collisions.
Definition: kapman.cpp:144
Maze
This class represents the Maze of the game.
Definition: maze.h:31
Kapman::getAskedXSpeed
qreal getAskedXSpeed() const
Definition: kapman.cpp:148
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