![]() |
Top-down Shooter With Death
A Top-Down Shooter in Which Characters Die
|
The bullet object. More...
#include <Bullet.h>
Public Member Functions | |
CBullet (eSprite t, const Vector2 &p) | |
Constructor. 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 | |
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... | |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
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. | |
The abstract representation of a bullet object. Bullet objects die in a cloud of smoke when they collide with anything.
CBullet::CBullet | ( | eSprite | t, |
const Vector2 & | p | ||
) |
Create and initialize a bullet object given its initial position.
t | Sprite type of bullet. |
p | Initial position of bullet. |
|
protectedvirtual |
Response to collision, which for a bullet means playing a sound and a particle effect, and then dying.
norm | Collision normal. |
d | Overlap distance. |
pObj | Pointer to object being collided with (defaults to nullptr). |
Reimplemented from CObject.
|
protectedvirtual |
Create a smoke particle effect to mark the death of the bullet.
Reimplemented from CObject.