30 static void SetTexture(Texture *pTexture) { s_pTexture = pTexture; }
34 virtual void Update(
const GameTime *pGameTime);
38 virtual void Draw(SpriteBatch *pSpriteBatch);
43 virtual void Activate(
const Vector2 &position,
bool wasShotByPlayer =
true);
47 virtual float GetDamage()
const {
return m_damage; }
51 virtual std::string
ToString()
const;
69 virtual void SetManualDraw(
const bool drawManually =
true) { m_drawnByLevel = !drawManually; }
76 virtual void SetSpeed(
const float speed) { m_speed = speed; }
80 virtual void SetDamage(
const float damage) { m_damage = damage; }
84 virtual void SetDirection(
const Vector2 direction) { m_direction = direction; }
88 virtual float GetSpeed()
const {
return m_speed; }
111 static Texture *s_pTexture;
118 bool m_wasShotByPlayer;
virtual void SetSpeed(const float speed)
Sets the speed of the projectile.
Definition: Projectile.h:76
virtual CollisionType GetProjectileType() const
Gets the collision type mask for the projectile.
Definition: Projectile.h:101
virtual std::string ToString() const
Gets a string representation of the projectile.
Definition: Projectile.cpp:66
virtual void SetManualDraw(const bool drawManually=true)
Sets if the level should draw the projectile.
Definition: Projectile.h:69
virtual float GetDamage() const
Gets the damage of the projectile.
Definition: Projectile.h:47
virtual void SetDamage(const float damage)
Sets the amount of damage the projectile inflicts.
Definition: Projectile.h:80
Base class for all objects that will be updated and rendered on a GameplayScreen. ...
Definition: GameObject.h:29
virtual bool WasShotByPlayer() const
Determines if the projectile was shot by a player.
Definition: Projectile.h:96
Shooter Library is a library of classes, interfaces, and value types that provides a foundation for d...
Definition: Background.h:16
virtual void Update(const GameTime *pGameTime)
Called when the game determines it is time to draw a frame.
Definition: Projectile.cpp:30
virtual void SetDirection(const Vector2 direction)
Sets the direction of the projectile.
Definition: Projectile.h:84
virtual std::string GetProjectileTypeString() const
Gets a string representation of the projectile.
Definition: Projectile.h:106
virtual bool IsDrawnByLevel() const
Determines if the level should draw the projectile.
Definition: Projectile.h:64
virtual Vector2 & GetDirection()
Gets the direction of the projectile.
Definition: Projectile.h:92
virtual float GetSpeed() const
Gets the speed of the projectile in pixels per second.
Definition: Projectile.h:88
Base class for all projectile types.
Definition: Projectile.h:20
virtual void Draw(SpriteBatch *pSpriteBatch)
Called when the game determines it is time to draw a frame.
Definition: Projectile.cpp:50
static void SetTexture(Texture *pTexture)
Sets the texture of the player ship.
Definition: Projectile.h:30
static const CollisionType PROJECTILE
Represents a projectile.
Definition: CollisionType.h:34
virtual CollisionType GetCollisionType() const
Gets the collision type mask.
Definition: Projectile.cpp:71
Defines the types of game objects that can collide with each other.
Definition: CollisionType.h:20
virtual void Activate()
Activates the game object.
Definition: GameObject.h:71