Represents a projectile that can be fired by a weapon.
More...
#include <Projectile.h>
|
| | Projectile () |
| | Instantiate a projectile object.
|
| |
| virtual | ~Projectile () |
| |
| virtual void | Update (const GameTime &gameTime) |
| | Update the projectile.
|
| |
| virtual void | Draw (SpriteBatch &spriteBatch) |
| | Render the projectile.
|
| |
| virtual void | Activate (const Vector2 &position, bool wasShotByPlayer=true) |
| | Activate the projectile.
|
| |
| virtual float | GetDamage () const |
| | Get the amount of damage the projectile will deal.
|
| |
| virtual std::string | ToString () const |
| | Get the string representation of the projectile.
|
| |
| virtual CollisionType | GetCollisionType () const |
| | Get the type of collision the projectile will have.
|
| |
| | GameObject () |
| | Instantiate a game object.
|
| |
| virtual | ~GameObject () |
| |
| virtual bool | IsActive () const |
| | Flag to determine if the object is active.
|
| |
| virtual void | Activate () |
| | Activate the object.
|
| |
| virtual void | Deactivate () |
| | Deactivate the object.
|
| |
| virtual Vector2 & | GetPosition () |
| | Get the position of the object.
|
| |
| virtual Vector2 & | GetPreviousPosition () |
| | Get the position of the object during the previous frame.
|
| |
| virtual Vector2 | GetHalfDimensions () const |
| | Get the half dimensions of the object.
|
| |
| virtual uint32_t | GetIndex () const |
| | Get the index of the object. Each object is assigned a unique ID when created, starting at 0.
|
| |
| virtual float | GetCollisionRadius () const |
| | Get the collision radius of the object.
|
| |
| virtual void | Hit (const float damage) |
| | Hits the object with a specified amount of damage.
|
| |
| virtual bool | HasMask (CollisionType mask) const |
| | Check if the object has a specific collision bit-mask.
|
| |
| virtual bool | IsMask (CollisionType mask) const |
| |
| virtual bool | IsDrawnByLevel () const |
| |
Represents a projectile that can be fired by a weapon.
Definition at line 8 of file Projectile.h.
◆ Projectile()
| Projectile::Projectile |
( |
| ) |
|
Instantiate a projectile object.
Definition at line 7 of file Projectile.cpp.
◆ ~Projectile()
| virtual Projectile::~Projectile |
( |
| ) |
|
|
inlinevirtual |
◆ Activate()
| void Projectile::Activate |
( |
const Vector2 & | position, |
|
|
bool | wasShotByPlayer = true ) |
|
virtual |
Activate the projectile.
- Parameters
-
| position | The position to activate the projectile at. |
| wasShotByPlayer | A flag to determine if the projectile was fired by the player. |
Definition at line 42 of file Projectile.cpp.
◆ Draw()
Render the projectile.
- Parameters
-
| spriteBatch | A reference to the game's sprite batch, used for rendering. |
Implements GameObject.
Definition at line 33 of file Projectile.cpp.
◆ GetCollisionType()
Get the type of collision the projectile will have.
- Returns
- The type of collision the projectile will have.
Implements GameObject.
Definition at line 55 of file Projectile.cpp.
◆ GetDamage()
| virtual float Projectile::GetDamage |
( |
| ) |
const |
|
inlinevirtual |
Get the amount of damage the projectile will deal.
- Returns
- The amount of damage the projectile will deal.
Definition at line 36 of file Projectile.h.
◆ GetDirection()
| virtual Vector2 & Projectile::GetDirection |
( |
| ) |
|
|
inlineprotectedvirtual |
Get the direction of the projectile.
- Returns
- The direction of the projectile.
Definition at line 67 of file Projectile.h.
◆ GetProjectileType()
Get the collision type of the projectile.
- Returns
- The collision type of the projectile.
Definition at line 75 of file Projectile.h.
◆ GetSpeed()
| virtual float Projectile::GetSpeed |
( |
| ) |
const |
|
inlineprotectedvirtual |
Get the speed of the projectile.
- Returns
- The speed of the projectile.
Definition at line 63 of file Projectile.h.
◆ SetDamage()
| virtual void Projectile::SetDamage |
( |
const float | damage | ) |
|
|
inlineprotectedvirtual |
Set the amount of damage the projectile will deal.
- Parameters
-
| damage | The amount of damage the projectile will deal. |
Definition at line 55 of file Projectile.h.
◆ SetDirection()
| virtual void Projectile::SetDirection |
( |
const Vector2 | direction | ) |
|
|
inlineprotectedvirtual |
Set the direction of the projectile.
- Parameters
-
| direction | The direction of the projectile. |
Definition at line 59 of file Projectile.h.
◆ SetSpeed()
| virtual void Projectile::SetSpeed |
( |
const float | speed | ) |
|
|
inlineprotectedvirtual |
Set the speed of the projectile.
- Parameters
-
| speed | The speed of the projectile. |
Definition at line 51 of file Projectile.h.
◆ SetTexture()
| static void Projectile::SetTexture |
( |
Texture * | pTexture | ) |
|
|
inlinestatic |
Set the texture that will be used to render the projectile.
- Parameters
-
| pTexture | A pointer to the texture. |
Definition at line 19 of file Projectile.h.
◆ ToString()
| std::string Projectile::ToString |
( |
| ) |
const |
|
virtual |
Get the string representation of the projectile.
- Returns
- The string representation of the projectile.
Implements GameObject.
Definition at line 50 of file Projectile.cpp.
◆ Update()
| void Projectile::Update |
( |
const GameTime & | gameTime | ) |
|
|
virtual |
Update the projectile.
- Parameters
-
| pGameTime | Timing values including time since last update. |
Reimplemented from GameObject.
Definition at line 13 of file Projectile.cpp.
◆ WasShotByPlayer()
| virtual bool Projectile::WasShotByPlayer |
( |
| ) |
const |
|
inlineprotectedvirtual |
Determine if the projectile was fired by the player.
- Returns
- True if the projectile was fired by the player.
Definition at line 71 of file Projectile.h.
The documentation for this class was generated from the following files: