![]() |
Platformer Prototype
A Bare-Bones Platformer
|
The object manager. More...
#include <ObjectManager.h>
Public Member Functions | |
virtual void | clear () |
Reset to empty and delete all objects. More... | |
CObject * | create (eSprite, const Vector2 &) |
Create new object. More... | |
virtual void | draw () |
Draw all objects. More... | |
void | FireGun (CObject *, eSprite) |
Fire object's gun. More... | |
const bool | LevelCompleted () const |
Level completed. More... | |
Private Member Functions | |
void | BroadPhase () |
Broad phase collision detection and response. More... | |
void | NarrowPhase (CObject *, CObject *) |
Narrow phase collision detection and response. More... | |
Private Attributes | |
bool | m_bLevelCompleted = false |
Level completion flag. | |
Additional Inherited Members | |
![]() | |
static LSpriteRenderer * | m_pRenderer = nullptr |
Pointer to renderer. | |
static CObjectManager * | m_pObjectManager = nullptr |
Pointer to object manager. | |
static LParticleEngine2D * | m_pParticleEngine = nullptr |
Pointer to particle engine. | |
static CTileManager * | m_pTileManager = nullptr |
Pointer to tile manager. | |
static bool | m_bDrawAABBs = false |
Draw AABB flag. | |
static bool | m_bGodMode = false |
God mode flag. | |
static Vector2 | m_vWorldSize = Vector2::Zero |
World height and width. | |
static CPlayer * | m_pPlayer = nullptr |
Pointer to player character. | |
A collection of all of the game objects.
|
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.
|
virtual |
Clear the object list and reset the level completion flag.
Create an object and put a pointer to it at the back of the object list m_stdObjectList
, which it inherits from LBaseObjectManager
.
t | Sprite type. |
pos | Initial position. |
|
virtual |
Draw the tiled background and the objects in the object list.
Create a bullet object and a flash particle effect. It is assumed that the object is round and that the bullet appears at the edge of the object in the direction that it is facing and continues moving in that direction.
pObj | Pointer to an object. |
bullet | Sprite type of bullet. |
const bool CObjectManager::LevelCompleted | ( | ) | const |
Reader function for the level completion flag.
Perform collision detection and response for a pair of objects. Makes use of the helper function Identify() because this function may be called with the objects in an arbitrary order.
p0 | Pointer to the first object. |
p1 | Pointer to the second object. |