![]() |
The Blank Game
A Blank 2D Game with Sound and a Sprite
|
The game object. More...
#include <Object.h>


Public Member Functions | |
| CObject (eObject, eSprite, const Vector2 &) | |
| Constructor. | |
| virtual | ~CObject () |
| Destructor. | |
| void | Move () |
| Move object. | |
| void | Draw () |
| Draw object. | |
Protected Attributes | |
| eObject | m_eObject = eObject::Unknown |
| Object type. | |
| eSprite | m_eSprite = eSprite::TextWheel |
| Sprite type. | |
| Vector2 | m_vPos |
| Position. | |
| float | m_fRoll = 0 |
| Roll angle. | |
Friends | |
| class | Sage::CObjectManager< CObject > |
| Object manager has full access. | |
Additional Inherited Members | |
Static Protected Attributes inherited from CCommon | |
| static Sage::CSpriteRenderer * | m_pRenderer = nullptr |
| Pointer to the renderer. | |
CObject is the abstract representation of a game object such as the player / character, non-player characters, and furniture. Objects will be / managed by an object managerSage::CObjectManager<CObject>, which is a / friend ofCObjectso that it can access any private members as needed to / manage the objects without the need for get and set functions for each / private or protected member variable. It is derived fromSage::CObject, / and therefore must contain public member functionsMove()andDraw()` to move and draw itself, respectively.
Create and initialize an object.
| obj | Object type. |
| spr | Sprite type. |
| p | Initial position of object. |
| void CObject::Draw | ( | ) |
Draw the sprite offset by the center offset.
| void CObject::Move | ( | ) |
Move object an amount that depends on the frame time.