diff options
Diffstat (limited to 'src/particle.h')
-rw-r--r-- | src/particle.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/particle.h b/src/particle.h index 1859fe62..7b46a641 100644 --- a/src/particle.h +++ b/src/particle.h @@ -162,6 +162,10 @@ class Particle : public Sprite moveBy(float x, float y, float z) { mPos.x += x; mPos.y += y; mPos.z += z; } + void + moveBy (Vector change) + { mPos += change; } + /** * Sets the time in game ticks until the particle is destroyed. */ @@ -186,6 +190,13 @@ class Particle : public Sprite { mFadeIn = fadeIn; } /** + * Sets the alpha value of the particle + */ + void + setAlpha(float alpha) + { mAlpha = alpha; } + + /** * Sets the sprite iterator of the particle on the current map to make * it easier to remove the particle from the map when it is destroyed. */ @@ -218,8 +229,8 @@ class Particle : public Sprite * Sets the ammount of random vector changes */ void - setRandomnes(int r) - { mRandomnes = r; } + setRandomness(int r) + { mRandomness = r; } /** * Sets the ammount of velocity particles retain after @@ -230,6 +241,20 @@ class Particle : public Sprite { mBounce = bouncieness; } /** + * Sets the flag if the particle is supposed to be moved by its parent + */ + void + setFollow(bool follow) + { mFollow = follow; } + + /** + * Gets the flag if the particle is supposed to be moved by its parent + */ + bool + doesFollow() + { return mFollow; } + + /** * Makes the particle move toward another particle with a * given acceleration and momentum */ @@ -267,6 +292,7 @@ class Particle : public Sprite int mLifetimePast; /**< Age of the particle in game ticks*/ int mFadeOut; /**< Lifetime in game ticks left where fading out begins*/ int mFadeIn; /**< Age in game ticks where fading in is finished*/ + float mAlpha; /**< Opacity of the graphical representation of the particle */ private: // generic properties @@ -279,8 +305,9 @@ class Particle : public Sprite // dynamic particle Vector mVelocity; /**< Speed in pixels per game-tick. */ float mGravity; /**< Downward acceleration in pixels per game-tick. */ - int mRandomnes; /**< Ammount of random vector change */ + int mRandomness; /**< Ammount of random vector change */ float mBounce; /**< How much the particle bounces off when hitting the ground */ + bool mFollow; /**< is this particle moved when its parent particle moves? */ // follow-point particles Particle *mTarget; /**< The particle that attracts this particle*/ |