X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fwind.hpp;h=e52add7c176350b9ea86b2c9fcafa93b9a3e0777;hb=555d1b7bebb45326d82d934e07463209837309b0;hp=39e5fd59473b10a4ff1d3c0f4a5c20b06d51c262;hpb=7d731b516a5181ce4f39b0339c7bce1cdc7c0baa;p=supertux.git diff --git a/src/object/wind.hpp b/src/object/wind.hpp index 39e5fd594..e52add7c1 100644 --- a/src/object/wind.hpp +++ b/src/object/wind.hpp @@ -24,13 +24,14 @@ #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 -