33 virtual bool IsActive()
const {
return m_lifeRemaining > 0; }
49 virtual float GetScale()
const {
return m_scale; }
73 virtual void SetScale(
const float scale) { m_scale = scale; }
78 m_lifeSpan = lifeSpan;
84 m_position = position;
85 m_lifeRemaining = m_lifeSpan;
91 m_lifeRemaining -= elapsed;
92 if (m_lifeRemaining < 0) m_lifeRemaining = 0;
93 m_lifePercentage = m_lifeRemaining / m_lifeSpan;
94 m_position += m_velocity * elapsed;
105 float m_lifeSpan = 0;
106 float m_lifeRemaining = 0;
107 float m_lifePercentage = 0;
Represents a four-component color using red, green, blue, and alpha data.
static const Color White
White.
Contains timing values for game updates and rendering.
double GetElapsedTime() const
Gets the time in seconds since last frame.
Interface for a particle.
Instantiate a basic particle.
virtual bool IsActive() const
Gets whether the particle is active.
virtual float GetScale() const
Gets the scale of the particle.
virtual float GetLifePercentage() const
virtual Vector2 GetPosition() const
Gets the position of the particle.
virtual Vector2 GetVelocity() const
Gets the velocity of the particle.
virtual void SetPosition(const Vector2 position)
Sets the position of the particle.
virtual void SetVelocity(const Vector2 velocity)
Sets the velocity of the particle.
virtual void SetLifeSpan(const float lifeSpan)
Sets the life span of the particle.
virtual float GetLifeSpan() const
Gets the life span of the particle.
virtual Color GetColor() const
Gets the color of the particle.
virtual void Update(const GameTime &gameTime)
virtual void Initialize(Vector2 &position)
virtual float GetLifeRemaining() const
Gets the life remaining of the particle.
virtual void SetScale(const float scale)
Sets the scale of the particle.
virtual void SetColor(const Color color)
Sets the color of the particle.
Defines a vector with 2 components (x and y).
Katana Engine is a library of classes, interfaces, and value types that provides a foundation for dev...