39 #ifndef HEADER_SUPERTUX_OBJECT_AMBIENT_SOUND_HPP 40 #define HEADER_SUPERTUX_OBJECT_AMBIENT_SOUND_HPP 42 #include "math/vector.hpp" 43 #include "supertux/moving_object.hpp" 44 #include "scripting/ambient_sound.hpp" 45 #include "squirrel/exposed_object.hpp" 56 AmbientSound(
const Vector& pos,
float factor,
float bias,
float vol,
const std::string& file);
61 virtual std::string get_class()
const override {
return "ambient-sound"; }
62 virtual std::string get_display_name()
const override {
return _(
"Ambient sound"); }
68 virtual void set_pos(
const Vector& pos)
override;
70 void set_pos(
float x,
float y);
71 float get_pos_x()
const;
72 float get_pos_y()
const;
78 virtual void after_editor_set()
override;
81 virtual void update(
float dt_sec)
override;
82 virtual void start_playing();
83 virtual void stop_playing();
87 std::unique_ptr<SoundSource> sound_source;
90 float distance_factor;
92 float silence_distance;
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:162
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: ambient_sound.cpp:252
Simple two dimensional vector.
Definition: vector.hpp:24
This class binds a certain GameObject class to a scripting class.
Definition: exposed_object.hpp:45
Definition: ambient_sound.hpp:51
Definition: object_settings.hpp:35
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:246
Base class for all the things that make up Levels' Sectors.
Definition: game_object.hpp:46
Base class for all dynamic/moving game objects.
Definition: moving_object.hpp:31
A sound source represents the source of audio output.
Definition: sound_source.hpp:25
virtual bool has_variable_size() const override
Does this object have variable size (secret area trigger, wind, etc.)
Definition: ambient_sound.hpp:63
Definition: reader_mapping.hpp:31
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
This class collects data about a collision.
Definition: collision_hit.hpp:44