18 #ifndef HEADER_SUPERTUX_OBJECT_AMBIENT_SOUND_HPP 19 #define HEADER_SUPERTUX_OBJECT_AMBIENT_SOUND_HPP 21 #include "math/vector.hpp" 22 #include "supertux/moving_object.hpp" 23 #include "video/layer.hpp" 38 static void register_class(ssq::VM& vm);
42 AmbientSound(
const Vector& pos,
float radius,
float vol,
const std::string& file);
47 static std::string class_name() {
return "ambient-sound"; }
48 virtual std::string get_class_name()
const override {
return class_name(); }
49 virtual std::string get_exposed_class_name()
const override {
return "AmbientSound"; }
50 static std::string display_name() {
return _(
"Ambient Sound"); }
59 virtual int get_layer()
const override {
return LAYER_OBJECTS; }
64 #ifdef DOXYGEN_SCRIPTING 70 float get_pos_x()
const;
76 float get_pos_y()
const;
80 virtual void update(
float dt_sec)
override;
83 void prepare_sound_source();
87 std::unique_ptr<SoundSource> m_sound_source;
92 bool m_has_played_sound;
virtual void play_looping_sounds() override
continues all looping sounds
Definition: ambient_sound.cpp:117
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: ambient_sound.cpp:126
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: ambient_sound.cpp:102
An ""AmbientSound"" that was given a name can be controlled by scripts.
Definition: ambient_sound.hpp:35
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: ambient_sound.hpp:53
Definition: object_settings.hpp:39
virtual HitResponse collision(GameObject &other, const CollisionHit &hit_) override
this function is called when the object collided with any other object
Definition: ambient_sound.cpp:96
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
Base class for all dynamic/moving game objects.
Definition: moving_object.hpp:35
A sound source represents the source of audio output.
Definition: sound_source.hpp:25
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: moving_object.hpp:49
A helper structure to list all the type_indexes of the classes in the type hierarchy of a given class...
Definition: game_object.hpp:57
virtual bool has_variable_size() const override
Does this object have variable size (secret area trigger, wind, etc.)
Definition: ambient_sound.hpp:52
Definition: reader_mapping.hpp:32
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
virtual void stop_looping_sounds() override
stops all looping sounds
Definition: ambient_sound.cpp:110
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: ambient_sound.hpp:51
This class collects data about a collision.
Definition: collision_hit.hpp:44