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


Public Member Functions | |
| CBullet (eSprite, const Vector2 &) | |
| Constructor. | |
| void | Move () |
| Move bullet. | |
Public Member Functions inherited from CObject | |
| CObject (eObject, eSprite, const Vector2 &) | |
| Constructor. | |
| virtual | ~CObject () |
| Destructor. | |
| virtual void | Draw () |
| Draw object. | |
| const eObject | GetType () const |
| Get object type. | |
Protected Member Functions | |
| void | CollisionResponse (const Vector2 &, float, CObject *=nullptr) |
| Collision response. | |
| void | DeathFX () |
| Death special effects. | |
| void | DeathFX (eObject) |
| Death special effects. | |
Protected Attributes | |
| Vector2 | m_vVelocity |
| Velocity. | |
Protected Attributes inherited from CObject | |
| 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 a bullet object. Bullet objects die in a cloud of smoke when they collide with a wall and a blood spatter when they collide with anything else.
| CBullet::CBullet | ( | eSprite | spr, |
| const Vector2 & | p ) |
Create and initialize a bullet object given its initial position.
| spr | Sprite enumerated type. |
| 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.

|
protected |
Create a smoke particle effect to mark the death of the bullet.

|
protected |
Create a particle effect to mark the death of the bullet depending on the type of object that it collided with.
| t | Object type of impacted object. |
|
virtual |
Move bullet an amount that depends on its velocity and the frame time.
Reimplemented from CObject.