![]() |
Top-down Shooter With Death
A Top-Down Shooter in Which Characters Die
|
The turret object. More...
#include <Turret.h>
Public Member Functions | |
CTurret (const Vector2 &p) | |
Constructor. More... | |
virtual void | move () |
Move turret. More... | |
![]() | |
CObject (eSprite, const Vector2 &) | |
Constructor. More... | |
virtual | ~CObject () |
Destructor. | |
void | move () |
Move object. More... | |
void | draw () |
Draw object. More... | |
const bool | isBullet () const |
Is a bullet. More... | |
Protected Member Functions | |
void | RotateTowards (const Vector2 &) |
Swivel towards position. More... | |
virtual void | CollisionResponse (const Vector2 &, float, CObject *=nullptr) |
Collision response. More... | |
virtual void | DeathFX () |
Death special effects. More... | |
![]() | |
const Vector2 | GetViewVector () const |
Compute view vector. More... | |
Protected Attributes | |
const UINT | m_nMaxHealth = 8 |
Maximum health. | |
UINT | m_nHealth = m_nMaxHealth |
Current health. | |
![]() | |
float | m_fRadius = 0 |
Bounding circle radius. | |
float | m_fSpeed = 0 |
Speed. | |
float | m_fRotSpeed = 0 |
Rotational speed. | |
Vector2 | m_vVelocity |
Velocity. | |
bool | m_bStatic = true |
Is static (does not move). | |
bool | m_bIsTarget = true |
Is a target. | |
bool | m_bIsBullet = false |
Is a bullet. | |
LEventTimer * | m_pGunFireEvent = nullptr |
Gun fire event. | |
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 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. | |
CTurret is the abstract representation of a turret object.
CTurret::CTurret | ( | const Vector2 & | p | ) |
Create and initialize a turret object given its position.
p | Position of turret. |
|
protectedvirtual |
Response to collision.
norm | Collision normal. |
d | Overlap distance. |
pObj | Pointer to object being collided with (defaults to nullptr , which means collision with a wall). |
Reimplemented from CObject.
|
protectedvirtual |
Perform a particle effect to mark the death of the turret.
Reimplemented from CObject.
|
virtual |
Rotate the turret and fire the gun at at the closest available target if there is one, and rotate the turret at a constant speed otherwise.
|
protected |
Rotate the turrent towards a point and file the gun if it is facing sufficiently close to it.
pos | Target point. |