![]() |
The Stroop Test Game
Ian Parberry's "Introduction to Game Physics"
|
The common variables class. More...
#include <Common.h>
Static Protected Attributes | |
static b2World * | m_pPhysicsWorld = nullptr |
Pointer to Box2D Physics World. | |
static CRenderer * | m_pRenderer = nullptr |
Pointer to the Renderer. | |
static CObjectManager * | m_pObjectManager = nullptr |
Pointer to the Object Manager. | |
static LParticleEngine2D * | m_pParticleEngine = nullptr |
Pointer to particle engine. | |
static CVectorField * | m_pVectorField = nullptr |
Pointer to a vector field. | |
static CBubbleEngine * | m_pBubbleEngine = nullptr |
Pointer to a bubble engine. | |
static bool | m_bDrawVectors = false |
Do we draw the vector field? | |
static bool | m_bDrawPressure = false |
Do we draw the pressures from the vector field? | |
static bool | m_bDrawPoints = false |
Do we draw the points from the vector field? | |
static bool | m_bDrawParticles = true |
Do we draw particles? | |
static eWordColor | m_eCurColor = eWordColor::Black |
Color of the current word. | |
static bool | m_bTried = false |
Whether the player has tried on the current word. | |
static UINT | m_nWordCnt = INITIAL_WORDCOUNT |
Number of words. | |
static UINT | m_nScore = 0 |
Current score, can be negatice. | |
static UINT | m_nDelivered = 0 |
Number of words delivered. | |
static UINT | m_nExcellent = 0 |
Number of words scored as excellent. | |
static UINT | m_nGood = 0 |
Number of words scored as excellent. | |
static UINT | m_nFair = 0 |
Number of words scored as excellent. | |
static UINT | m_nFailed = 0 |
Number of words the player got wrong. | |
static UINT | m_nMissed = 0 |
Number of words the player did not attempt. | |
static eGameState | m_eGameState = eGameState::Instructions |
Current game state. | |
static UINT | m_nCntdownNum = 0 |
The number we are displaying in the countdown. | |
The common variables class.
CCommon is a singleton class that encapsulates things that are common to different game components, including game state variables. Making it a singleton class means that we can avoid passing its member variables around as parameters, which makes the code minisculely faster, and more importantly, reduces function clutter.