![]() |
The Top Down Game Prototype
A Basic Top Down Shooter
|
The game object. More...
#include <Object.h>


Public Member Functions | |
| CObject (eObject, eSprite, const Vector2 &) | |
| Constructor. | |
| virtual | ~CObject () |
| Destructor. | |
| virtual void | Move () |
| Move object. | |
| virtual void | Draw () |
| Draw object. | |
| virtual void | CollisionResponse (const Vector2 &, float, CObject *=nullptr) |
| Collision response. | |
| const eObject | GetType () const |
| Get object type. | |
Protected Attributes | |
| eObject | m_eObject = eObject::Unknown |
| Object type. | |
| eSprite | m_eSprite = eSprite::Player |
| Sprite type. | |
| Vector2 | m_vPos |
| Position. | |
| float | m_fRoll = 0 |
| Roll angle. | |
| float | m_fRadius = 0 |
| Bounding circle radius. | |
Friends | |
| class | CObjectManager |
| Object manager needs access so it can manage. | |
Additional Inherited Members | |
Static Protected Attributes inherited from CCommon | |
| static Sage::CSpriteRenderer * | m_pRenderer = nullptr |
| Pointer to renderer. | |
| static CObjectManager * | m_pObjectManager = nullptr |
| Pointer to object manager. | |
| static Sage::CParticleEngine2D * | m_pParticleEngine = nullptr |
| Pointer to particle engine. | |
| static CPlayer * | m_pPlayer = nullptr |
| Pointer to player character. | |
| static bool | m_bGodMode = false |
| God mode flag. | |
| static bool | m_bShowState = false |
| Show NPC state flag. | |
| static bool | m_bShowBounds = false |
| Show collision circle flag. | |
The abstract representation of an object. CObjectManager is a friend of this class so that it can access any private members as needed to manage the objects without the need for reader and set functions for each private or protected member variable. This class must contain public member functions Move() and Draw() to move and draw the object, respectively.
Create and initialize an object.
| obj | Object type. |
| spr | Sprite type. |
| p | Initial position of object. |
|
virtual |
Response to a collision, which is to move back the overlap distance along the collision normal.
| norm | Collision normal. |
| d | Overlap distance. |
| pObj | Pointer to object being collided with (defaults to nullptr, which means collision with a wall). |
Reimplemented in CBullet, CGuard, and CPlayer.

|
virtual |
Draw sprite.
Reimplemented in CArmedObject, and CGuard.
| const eObject CObject::GetType | ( | ) | const |
Reader function for the object type.

|
virtual |
Stub.
Reimplemented in CArmedObject, CBullet, CGuard, and CPlayer.