kgoldrunner
kgrrunner.cpp
Go to the documentation of this file.
KGrHero(KGrLevelPlayer *pLevelPlayer, KGrLevelGrid *pGrid, int i, int j, int pSpriteId, KGrRuleBook *pRules)
The constructor of the KGrHero class.
Definition: kgrrunner.cpp:198
void unstackEnemy(const int spriteId, const int gridI, const int gridJ, const int prevEnemy)
Helper function to remove an enemy from among several stacked in a cell.
Definition: kgrlevelplayer.cpp:728
bool heroCaught(const int heroX, const int heroY)
Helper function to determine whether the hero has collided with an enemy and must lose a life (unless...
Definition: kgrlevelplayer.cpp:632
void enemyReappear(int &gridI, int &gridJ)
Helper function to determine where an enemy should reappear after being trapped in a brick...
Definition: kgrlevelplayer.cpp:880
Definition: kgrglobals.h:207
void soundSignal(const int n, const bool onOff=true)
Class to play, record and play back a level of a game.
Definition: kgrlevelplayer.h:65
Definition: kgrlevelgrid.h:27
Definition: kgrglobals.h:204
KGrEnemy(KGrLevelPlayer *pLevelPlayer, KGrLevelGrid *pGrid, int i, int j, int pSpriteId, KGrRuleBook *pRules)
The constructor of the KGrEnemy class.
Definition: kgrrunner.cpp:354
int runnerGotGold(const int spriteId, const int i, const int j, const bool hasGold, const bool lost=false)
Helper function for an enemy to pick up or drop gold or the hero to collect gold. ...
Definition: kgrlevelplayer.cpp:820
Definition: kgrglobals.h:220
void getHeroTimes(int &runTime, int &fallTime, int &enemyFallTime, int &trapTime)
Definition: kgrrulebook.h:48
Definition: kgrglobals.h:175
Definition: kgrglobals.h:220
Definition: kgrglobals.h:206
Definition: kgrglobals.h:204
bool bumpingFriend(const int spriteId, const Direction dirn, const int gridI, const int gridJ)
Helper function to determine whether an enemy is colliding with another enemy.
Definition: kgrlevelplayer.cpp:672
Definition: kgrglobals.h:205
void changeCellAt(const int i, const int j, const char type)
Definition: kgrlevelgrid.cpp:113
Definition: kgrglobals.h:174
Definition: kgrglobals.h:187
int elapsed() const
void setEnemyOccupied(int i, int j, const int spriteId)
Definition: kgrlevelgrid.h:54
Definition: kgrrunner.h:30
Definition: kgrglobals.h:70
Definition: kgrrunner.h:30
Definition: kgrrulebook.h:30
HeroStatus run(const int scaledTime)
Makes the hero run, under control of a pointer or the keyboard and guided by the layout of the grid...
Definition: kgrrunner.cpp:214
Definition: kgrglobals.h:70
void startAnimation(const int spriteId, const bool repeating, const int i, const int j, const int time, const Direction dirn, const AnimationType type)
Requests the view-object to display an animation of a runner at a particular cell, cancelling and superseding any current animation.
Definition: kgrglobals.h:70
int restart()
Definition: kgrglobals.h:207
Definition: kgrglobals.h:187
uchar randomByte(const uchar limit)
Helper function to provide enemies with random numbers for reappearing and deciding whether to pick u...
Definition: kgrlevelplayer.cpp:925
Direction getDirection(int heroI, int heroJ)
Helper function for the hero to find his next direction when using mouse or touchpad control...
Definition: kgrlevelplayer.cpp:480
Definition: kgrglobals.h:174
void showState()
Implements the author's debugging aid that shows the hero's state.
Definition: kgrrunner.cpp:344
KGrRunner(KGrLevelPlayer *pLevelPlayer, KGrLevelGrid *pGrid, int i, int j, const int pSpriteId, KGrRuleBook *pRules, const int startDelay)
The constructor of the KGrRunner virtual class.
Definition: kgrrunner.cpp:27
This class provides the shared features of all runners (hero and enemies).
Definition: kgrrunner.h:35
Definition: kgrglobals.h:174
Definition: kgrrunner.h:30
Definition: kgrglobals.h:70
void incScore(const int n)
Requests the KGoldrunner game to add to the human player's score.
bool dig(const Direction dirn, int &digI, int &digJ)
Decides whether the hero can dig as is required by pressing a key or a mouse-button.
Definition: kgrrunner.cpp:305
char getEnemyTimes(int &runTime, int &fallTime, int &trapTime)
Definition: kgrrulebook.h:53
bool setNextMovement(const char spriteType, const char cellType, Direction &dir, AnimationType &anim, int &interval)
Definition: kgrrunner.cpp:121
Definition: kgrglobals.h:70
Definition: kgrglobals.h:205
Definition: kgrglobals.h:174
Definition: kgrglobals.h:220
void start()
Definition: kgrrunner.h:30
void showState()
Implements the author's debugging aid that shows the enemy's state.
Definition: kgrrunner.cpp:610
Definition: kgrgameio.h:29
void run(const int scaledTime)
Makes an enemy run, guided by the position of the hero and the layout of the grid.
Definition: kgrrunner.cpp:378
Direction getEnemyDirection(int enemyI, int enemyJ, bool leftRightSearch)
Helper function for an enemy to find his next direction, based on where the hero is and the search al...
Definition: kgrlevelplayer.cpp:621
Definition: kgrglobals.h:70
Definition: kgrglobals.h:174
Definition: kgrglobals.h:174
KGrEnemy * standOnEnemy(const int spriteId, const int x, const int y)
Helper function to determine whether the hero or an enemy is standing on an enemy's head...
Definition: kgrlevelplayer.cpp:652
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:24 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:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.