![]() |
The Cannon Lullaby Toy
Game Physics with a 2D Physics Engine
|
The common variables class. More...
#include <Common.h>


Static Protected Attributes | |
| static b2World * | m_pPhysicsWorld = nullptr |
| Pointer to Box2D Physics World. | |
| static CBox2DRenderer * | m_pRenderer = nullptr |
| Pointer to Render World. | |
| static CObjectManager * | m_pObjectManager = nullptr |
| Pointer to the Object Manager. | |
| static Sage::CParticleEngine2D * | m_pFrontParticleEngine = nullptr |
| Pointer to front particle engine. | |
| static Sage::CParticleEngine2D * | m_pBackParticleEngine = nullptr |
| Pointer to front particle engine. | |
| static CCannon * | m_pCannon = nullptr |
| Pointer to a cannon. | |
| static Vector2 | m_vBellPos [NUMBELLS] = {Vector2(0.0f)} |
| Positions of bells. | |
| static float | m_fGravity = 20.0f |
| Magnitude of gravity in Render World units. | |
| static eDrawMode | m_eDrawMode = eDrawMode::Sprites |
| Draw mode. | |
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.