Box2D Cannon Game
Chapter 7 of Ian Parberry's "Introduction to Game Physics with Box2D"
|
The object manager. More...
#include <ObjectManager.h>
Public Member Functions | |
CObjectManager (int size) | |
Constructor. | |
~CObjectManager () | |
Destructor. | |
CGameObject * | create (GameObjectType objecttype) |
Create new object. | |
void | move () |
Move all objects. | |
void | draw () |
Draw all objects. | |
void | clear () |
Clear the object list. | |
void | MakeSound () |
Make sounds. | |
Protected Attributes | |
CGameObject ** | m_pObjectList |
List of game objects. | |
int | m_nCount |
How many objects in list. | |
int | m_nSize |
Maximum size of list. | |
Friends | |
class | CObjectWorld |
The object manager.
The object manager is responsible for managing game objects.
void CObjectManager::clear | ( | ) |
Clear the object list.
Clear out all game objects from the object list.
CGameObject * CObjectManager::create | ( | GameObjectType | objecttype | ) |
Create new object.
Create a new instance of a game object.
objecttype | The type of the new object |
void CObjectManager::draw | ( | ) |
Draw all objects.
Ask the Render World to draw all game objects.
void CObjectManager::MakeSound | ( | ) |
Make sounds.
Make sounds for all objects in the object list.
void CObjectManager::move | ( | ) |
Move all objects.
Ask the Physics World to move all game objects.