The object manager.
More...
#include <ObjectManager.h>
|
| void | CreateCrate (float, float, const b2FixtureDef &) |
| | Create a crate.
|
| |
|
|
Sage::CParticleDesc2D | m_cSmokeDesc |
| | Particle descriptor for smoke particle.
|
| |
|
std::vector< CObject * > | m_stdList |
| | Object list.
|
| |
|
|
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 object manager.
|
| |
|
static Sage::CParticleEngine2D * | m_pParticleEngine = nullptr |
| | Pointer to particle engine.
|
| |
|
static eDrawMode | m_eDrawMode = eDrawMode::Sprites |
| | Draw mode.
|
| |
|
static bool | m_bEasterEgg = false |
| | Easter egg!
|
| |
The object manager is an abstract representation of all of the objects in the game.
◆ ~CObjectManager()
| CObjectManager::~CObjectManager |
( |
| ) |
|
The destructor clears the object list, which destructs all of the objects in it.
◆ AllCratesBelow()
| const bool CObjectManager::AllCratesBelow |
( |
float | h | ) |
const |
- Parameters
-
| h | Height in Render World units. |
- Returns
- true if all crates have y-coordinate less than h.
◆ clear()
| void CObjectManager::clear |
( |
| ) |
|
Delete all of the entities managed by the object manager. This involves deleting all of the CObject instances pointed to by the object list, then clearing the object list itself.
◆ CreateBackground()
| void CObjectManager::CreateBackground |
( |
eSprite | t | ) |
|
Create world edges in Physics World. Place Box2D edge shapes in the Physics World in places that correspond to the bottom, right, and left edges of the screen in Render World. The left and right edges continue upwards for a distance. There is no top to the world.
- Parameters
-
◆ CreateCrate()
| void CObjectManager::CreateCrate |
( |
float | x, |
|
|
float | y, |
|
|
const b2FixtureDef & | fd ) |
|
private |
Create a crate in Physics World and Object World.
- Parameters
-
| x | Horizontal coordinate in Physics World units. |
| y | Vertical coordinate in Physics World units. |
| fd | Crate fixture definition. |
◆ CreateObject()
| void CObjectManager::CreateObject |
( |
eSprite | t, |
|
|
b2Body * | p ) |
Create an object in the object manager.
- Parameters
-
| t | Sprite type. |
| p | Pointer to Physics World body. |
◆ CreateTower()
| void CObjectManager::CreateTower |
( |
| ) |
|
Create a tower of crates at a hard-coded location.
◆ EmitSmoke()
| void CObjectManager::EmitSmoke |
( |
const Vector2 & | p, |
|
|
Vector2 | v ) |
Create a smoke particle using the front particle engine so that it appears in front of the cannon. This particle will scale in and fade out over its lifespan, which is hard-coded. Friction is added to make it slow down horizontally, and upward acceleration is added to make it appear to rise due to the high temperature of an expolosion.
- Parameters
-
| p | Initial position. |
| v | Initial velocity. |
◆ MakeCollisionSounds()
| void CObjectManager::MakeCollisionSounds |
( |
| ) |
|
Make collision sounds for all objects.