32 virtual void Activate(
const Vector2 &position,
bool wasShotByPlayer =
true);
36 virtual float GetDamage()
const {
return m_damage; }
40 virtual std::string
ToString()
const;
51 virtual void SetSpeed(
const float speed) { m_speed = speed; }
55 virtual void SetDamage(
const float damage) { m_damage = damage; }
63 virtual float GetSpeed()
const {
return m_speed; }
87 bool m_wasShotByPlayer =
true;
Represents a type of collision.
static const CollisionType Projectile
Represents a game object in the game. This is the base class for all objects that can be updated,...
virtual void Activate()
Activate the object.
Contains timing values for game updates and rendering.
Enables a group of sprites to be drawn using the same settings.
Represents a 2D grid of texels.
Defines a vector with 2 components (x and y).
Represents a projectile that can be fired by a weapon.
static void SetTexture(Texture *pTexture)
Set the texture that will be used to render the projectile.
virtual CollisionType GetProjectileType() const
Get the collision type of the projectile.
virtual CollisionType GetCollisionType() const
Get the type of collision the projectile will have.
virtual bool WasShotByPlayer() const
Determine if the projectile was fired by the player.
virtual float GetSpeed() const
Get the speed of the projectile.
virtual float GetDamage() const
Get the amount of damage the projectile will deal.
virtual void SetDirection(const Vector2 direction)
Set the direction of the projectile.
virtual void SetDamage(const float damage)
Set the amount of damage the projectile will deal.
virtual void SetSpeed(const float speed)
Set the speed of the projectile.
Projectile()
Instantiate a projectile object.
virtual std::string ToString() const
Get the string representation of the projectile.
virtual void Draw(SpriteBatch &spriteBatch)
Render the projectile.
virtual Vector2 & GetDirection()
Get the direction of the projectile.
virtual void Update(const GameTime &gameTime)
Update the projectile.