Tiled Platformer Prototype
A Basic Tiled Platformer
Loading...
Searching...
No Matches
CObjectManager Class Reference

The object manager. More...

#include <ObjectManager.h>

Inheritance diagram for CObjectManager:
Collaboration diagram for CObjectManager:

Public Member Functions

CObjectCreate (eObject, const Vector2 &)
 Create new object.
 
void Draw ()
 Draw all objects.
 
void Clear ()
 Reset to empty and delete all objects.
 
const bool LevelCompleted () const
 Level completed.
 

Private Member Functions

void BroadPhase ()
 Broad phase collision detection and response.
 
void NarrowPhase (CObject *, CObject *)
 Narrow phase collision detection and response.
 

Private Attributes

bool m_bLevelCompleted = false
 Level completion flag.
 

Additional Inherited Members

- Static Protected Attributes inherited from CCommon
static Sage::CSpriteRenderer * m_pRenderer = nullptr
 Pointer to renderer.
 
static CObjectManagerm_pObjectManager = nullptr
 Pointer to object manager.
 
static Sage::CParticleEngine2D * m_pParticleEngine = nullptr
 Pointer to particle engine.
 
static CTileManagerm_pTileManager = nullptr
 Pointer to tile manager.
 
static CPlayerm_pPlayer = nullptr
 Pointer to player character.
 
static Vector2 m_vWorldSize
 World height and width.
 
static bool m_bGodMode = false
 God mode flag.
 
static bool m_bShowBounds = false
 Draw bounding boxes and circles flag.
 
static eGameState m_eGameState = eGameState::Loading
 Game state.
 

Detailed Description

A collection of all of the game objects.

Member Function Documentation

◆ BroadPhase()

void CObjectManager::BroadPhase ( )
private

Perform collision detection and response for each object with the world edges and for all objects with another object, making sure that each pair of objects is processed only once.

Here is the call graph for this function:

◆ Clear()

void CObjectManager::Clear ( )

Clear the object list and reset the level completion flag.

Here is the caller graph for this function:

◆ Create()

CObject * CObjectManager::Create ( eObject t,
const Vector2 & pos )

Create an object and put a pointer to it at the back of the object list m_stdObjectList, which it inherits from LBaseObjectManager.

Parameters
tSprite type.
posInitial position.
Returns
Pointer to the object created.
Here is the caller graph for this function:

◆ Draw()

void CObjectManager::Draw ( )

Draw the tiled background and the objects in the object list.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LevelCompleted()

const bool CObjectManager::LevelCompleted ( ) const

Reader function for the level completion flag.

Returns
true if the level has been completed successfully.
Here is the caller graph for this function:

◆ NarrowPhase()

void CObjectManager::NarrowPhase ( CObject * p0,
CObject * p1 )
private

Perform collision detection and response for a pair of objects.

Parameters
p0Pointer to the first object.
p1Pointer to the second object.
Here is the call graph for this function: