![]() |
The Box2D Blank Game
A Blank 2D Game with Box2D and a Contact Listener for Sounds
|
The Object Manager. More...
#include <ObjectManager.h>
Public Member Functions | |
CObjectManager () | |
Constructor. More... | |
~CObjectManager () | |
Destructor. More... | |
void | CreateObject (eSprite, b2Body *) |
Create object. More... | |
void | clear () |
Reset to initial conditions. More... | |
void | Draw () |
Draw objects. More... | |
void | CreateWorldEdges () |
Create the edges of the world. More... | |
Private Attributes | |
LSpriteDesc2D | m_cBgDesc |
Descriptor for background image. | |
std::vector< CObject * > | m_stdList |
Object list. | |
Additional Inherited Members | |
![]() | |
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. | |
The abstract representation of the objects in the game.
CObjectManager::CObjectManager | ( | ) |
Fills in the details for the background image descriptor.
CObjectManager::~CObjectManager | ( | ) |
The destructor clears the object list, which destructs all of the objects in it.
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.
void CObjectManager::CreateObject | ( | eSprite | t, |
b2Body * | p | ||
) |
Create an object in the Object Manager and link its Physics World body to it.
t | Sprite type. |
p | Pointer to Box2D body. |
void CObjectManager::CreateWorldEdges | ( | ) |
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 the Renderer. The left and right edges continue upwards for a distance. There is no top to the world.
void CObjectManager::Draw | ( | ) |
Draw all objects.