preload sounds
[supertux.git] / src / badguy / treewillowisp.hpp
index b57dcc7..c95cbc8 100644 (file)
 
 #include "badguy.hpp"
 
+class GhostTree;
+
 class TreeWillOWisp : public BadGuy
 {
 public:
-  TreeWillOWisp(const Vector& pos, float radius, float speed);
+  TreeWillOWisp(GhostTree* tree, const Vector& pos, float radius, float speed);
   virtual ~TreeWillOWisp();
 
   void activate();
@@ -35,18 +37,26 @@ public:
    * make TreeWillOWisp vanish
    */
   void vanish();
+  void start_sucking(Vector suck_target);
+  bool was_sucked;
 
   void active_update(float elapsed_time);
   void set_color(const Color& color);
   Color get_color() const;
 
+  virtual bool is_flammable() const { return false; }
+  virtual bool is_freezable() const { return false; }
+  virtual void kill_fall() { vanish(); }
+
+  virtual void draw(DrawingContext& context);
+
 protected:
   virtual bool collides(GameObject& other, const CollisionHit& hit);
   HitResponse collision_player(Player& player, const CollisionHit& hit);
 
 private:
   enum MyState {
-    STATE_DEFAULT, STATE_VANISHING
+    STATE_DEFAULT, STATE_VANISHING, STATE_SUCKED
   };
   MyState mystate;
 
@@ -56,6 +66,10 @@ private:
   float speed;
 
   std::auto_ptr<SoundSource> sound_source;
+  Vector     treepos_delta;
+  GhostTree* tree;
+
+  Vector suck_target;
 };
 
 #endif