![]() |
The LARC Game Engine
A Simple Game Engine from the Laboratory for Recreational Computing
|
The basic game object. More...
#include <BaseObject.h>
Public Member Functions | |
template<class t > | |
LBaseObject (t, const Vector2 &) | |
Constructor. More... | |
virtual void | move () |
Move object stub. More... | |
virtual void | draw () |
Draw object stub. More... | |
const bool | IsReadyToDelete () const |
Is ready to be deleted from object list. More... | |
![]() | |
LSpriteDesc2D () | |
Constructor. More... | |
LSpriteDesc2D (UINT, const Vector2 &) | |
Constructor. More... | |
![]() | |
LSpriteDesc () | |
Constructor. More... | |
LSpriteDesc (UINT) | |
Constructor. More... | |
Protected Attributes | |
bool | m_bDead = false |
Is ready to delete from object list. | |
Additional Inherited Members | |
![]() | |
Vector2 | m_vPos = Vector2::Zero |
Position. | |
![]() | |
UINT | m_nSpriteIndex = 0 |
Sprite index. | |
UINT | m_nCurrentFrame = 0 |
Current animation frame. | |
float | m_fXScale = 1.0f |
Horizontal scale. | |
float | m_fYScale = 1.0f |
Vertical scale. | |
float | m_fRoll = 0.0f |
Z-axis rotation. | |
XMFLOAT4 | m_f4Tint = XMFLOAT4(1.0f, 1.0f, 1.0f, 1.0f) |
Color tint. | |
float | m_fAlpha = 1.0f |
Alpha channel, 0.0f for transparent, 1.0f for opaque. | |
![]() | |
static LTimer * | m_pTimer = &cTimer |
Pointer to a timer. More... | |
static LRandom * | m_pRandom = &cRandom |
Pointer to a PRNG. More... | |
static LKeyboard * | m_pKeyboard = &cKeyboard |
Pointer to a keyboard handler. More... | |
static LXBoxController * | m_pController = &cController |
Pointer to a XBox controller. More... | |
static LSound * | m_pAudio = &cAudio |
Pointer to an audio player. More... | |
LBaseObject
is a basic object containing the necessary functions and data for managing the object list, plus virtual function stubs for moving and drawing during animation. You should derive the object classes in your game from this class. It is designed for use with an object manager derived from LBaseObjectManager
. Simply set m_bDead
to true when the object is dead so that it can be cleaned up and deleted from the object list automatically in the next frame.
LBaseObject::LBaseObject | ( | t | e, |
const Vector2 & | p | ||
) |
t | Sprite enumerated type. |
e | Sprite type. |
p | Initial position of object. |
|
virtual |
Draw object. This function is a stub and should never be executed. If the programmer neglects to override this function, then the game will abort.
const bool LBaseObject::IsReadyToDelete | ( | ) | const |
Reader function for the member variable m_bDead
.
|
virtual |
Move object. This function is a stub and should never be executed. If the programmer neglects to override this function, then the game will abort.