summaryrefslogtreecommitdiff
path: root/src/particle.h
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-06-24 12:29:33 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-06-24 12:29:33 +0000
commitbea93daec3ad4e3345c701e5dcce250c44d128f2 (patch)
treeb8056f0d9ec3f634cf21c21e86a06094a43eb6fa /src/particle.h
parent5f391618757e93c010141380583ff487848286da (diff)
downloadMana-bea93daec3ad4e3345c701e5dcce250c44d128f2.tar.gz
Mana-bea93daec3ad4e3345c701e5dcce250c44d128f2.tar.bz2
Mana-bea93daec3ad4e3345c701e5dcce250c44d128f2.tar.xz
Mana-bea93daec3ad4e3345c701e5dcce250c44d128f2.zip
Added particle property "follow-parent" which makes the particle move when its parent particle is moved.
Diffstat (limited to 'src/particle.h')
-rw-r--r--src/particle.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/particle.h b/src/particle.h
index 5ba2668b..88a38417 100644
--- a/src/particle.h
+++ b/src/particle.h
@@ -160,6 +160,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.
*/
@@ -235,6 +239,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
*/
@@ -287,6 +305,7 @@ class Particle : public Sprite
float mGravity; /**< Downward acceleration in pixels per game-tick. */
int mRandomnes; /**< 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*/