Made invincibility sparkle a particle effect
[supertux.git] / src / moving_object.hpp
index 63950cc..e6ae483 100644 (file)
@@ -112,9 +112,32 @@ public:
    */
   virtual void set_pos(const Vector& pos)
   {
+    dest.move(pos-get_pos());
     bbox.set_pos(pos);
   }
 
+  /**
+   * sets the moving object's bbox to a specific width. Be careful when
+   * using this function. There are no collision detection checks performed
+   * here so bad things could happen.
+   */
+  virtual void set_width(float w)
+  {
+    dest.set_width(w);
+    bbox.set_width(w);
+  }
+
+  /**
+   * sets the moving object's bbox to a specific size. Be careful when
+   * using this function. There are no collision detection checks performed
+   * here so bad things could happen.
+   */
+  virtual void set_size(float w, float h)
+  {
+    dest.set_size(w, h);
+    bbox.set_size(w, h);
+  }
+
   CollisionGroup get_group() const
   {
     return group;