X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fambient_sound.hpp;h=a7a14bca770a151da39e9e093cc66d2a91b430f4;hb=1dfbd27a41341f26775ca4e2b9ca4864f5744a6f;hp=74d9c9d32cdcd4b61aa1e017377baf510caf7f0d;hpb=88fac7ee1f38465b6b3d2a9946962db1b1c41a94;p=supertux.git diff --git a/src/object/ambient_sound.hpp b/src/object/ambient_sound.hpp index 74d9c9d32..a7a14bca7 100644 --- a/src/object/ambient_sound.hpp +++ b/src/object/ambient_sound.hpp @@ -21,13 +21,13 @@ /** * Ambient Sound Source, gamma version. Features: * - * - "rounded rectancle" geometry with position, dimension and - * "rounding radius" (extending in all directions) of a 100% - * volume area, adjustable maximum volume, inverse square + * - "rounded rectancle" geometry with position, dimension and + * "rounding radius" (extending in all directions) of a 100% + * volume area, adjustable maximum volume, inverse square * falloff outside area. - * + * * - degenerates gracefully to a disc for dimension=0 - * + * * - parameters: * * x, y position @@ -36,8 +36,8 @@ * distance_bias high = big "100% disc" * silence_distance defaults reasonably. * sample sample to be played back in loop mode - * - * basti_ + * + * basti_ */ #ifndef __AMBIENT_SOUND_H__ @@ -47,10 +47,11 @@ #include "resources.hpp" #include "player.hpp" #include "script_interface.hpp" +#include "scripting/ambient_sound.hpp" class SoundSource; -class AmbientSound : public GameObject, public ScriptInterface +class AmbientSound : public GameObject, public ScriptInterface, public Scripting::AmbientSound { public: AmbientSound(const lisp::Lisp& lisp); @@ -65,6 +66,18 @@ public: { return position; } + + /** + * @name Scriptable Methods + * @{ + */ + void set_pos(float x, float y); + float get_pos_x() const; + float get_pos_y() const; + /** + * @} + */ + protected: virtual void hit(Player& player); virtual void update(float time); @@ -84,7 +97,7 @@ private: float distance_factor; /// distance scaling float distance_bias; /// 100% volume disc radius - float silence_distance; /// not implemented yet + float silence_distance; /// not implemented yet float maximumvolume; /// maximum volume float targetvolume; /// how loud we want to be @@ -94,4 +107,3 @@ private: }; #endif -