Changed jump behaviour: Tux will now jump even if the button was pressed (up to)...
[supertux.git] / src / object / wind.hpp
index 39e5fd5..e52add7 100644 (file)
 #include "moving_object.hpp"
 #include "math/rect.hpp"
 #include "sprite/sprite.hpp"
+#include "script_interface.hpp"
 
 class Player;
 
-/** 
+/**
  * Defines an area that will gently push Players in one direction
  */
-class Wind : public MovingObject
+class Wind : public MovingObject, public ScriptInterface
 {
 public:
   Wind(const lisp::Lisp& reader);
@@ -38,8 +39,31 @@ public:
   void update(float elapsed_time);
   void draw(DrawingContext& context);
   HitResponse collision(GameObject& other, const CollisionHit& hit);
-  
+
+  /**
+   * @name Scriptable Methods
+   * @{
+   */
+
+  /**
+   * start blowing
+   */
+  void start();
+
+  /**
+   * stop blowing
+   */
+  void stop();
+
+  /**
+   * @}
+   */
+
+  virtual void expose(HSQUIRRELVM vm, SQInteger table_idx);
+  virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx);
+
 private:
+  bool blowing; /**< true if wind is currently switched on */
   Vector speed;
   float acceleration;
 
@@ -47,4 +71,3 @@ private:
 };
 
 #endif
-