17 #ifndef HEADER_SUPERTUX_OBJECT_PARTICLE_ZONE_HPP 18 #define HEADER_SUPERTUX_OBJECT_PARTICLE_ZONE_HPP 20 #include "supertux/moving_object.hpp" 22 #include "video/layer.hpp" 32 virtual void update(
float dt_sec)
override;
36 static std::string class_name() {
return "particle-zone"; }
37 virtual std::string get_class_name()
const override {
return class_name(); }
38 static std::string display_name() {
return _(
"Particle zone"); }
44 virtual GameObjectTypes
get_types()
const override;
46 virtual int get_layer()
const override {
return LAYER_OBJECTS; }
104 std::string m_particle_name;
109 m_particle_name(std::move(name)),
115 Rectf get_rect()
const {
return m_rect;}
117 const std::string& get_particle_name()
const {
return m_particle_name;}
121 return ZoneDetails(m_particle_name, static_cast<ParticleZoneType>(m_type), m_col.m_bbox);
126 std::string m_particle_name;
void set_enabled(bool enabled)
Sets whether or not particles can spawn in this area.
Definition: particle_zone.hpp:67
Defines an area where a certain particle type can spawn.
Definition: particle_zone.hpp:25
Particles will disappear instantly if they leave this area.
Definition: particle_zone.hpp:56
Particles will spawn in this area.
Definition: particle_zone.hpp:52
Particles will die if they leave this area.
Definition: particle_zone.hpp:54
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: particle_zone.hpp:40
float current_y() const
Returns the current Y position of the zone.
Definition: particle_zone.hpp:92
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: particle_zone.hpp:39
float current_x() const
Move the area around.
Definition: particle_zone.hpp:89
Definition: object_settings.hpp:39
Rectf m_bbox
The bounding box of the object (as used for collision detection, this isn't necessarily the bounding ...
Definition: collision_object.hpp:150
virtual HitResponse collision(GameObject &other, const CollisionHit &hit) override
this function is called when the object collided with any other object
Definition: particle_zone.cpp:111
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: particle_zone.cpp:77
const std::string & get_particle_name() const
Returns the name of the particle object for this area.
Definition: particle_zone.hpp:76
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
Particles will start dying if they touch this area.
Definition: particle_zone.hpp:58
Particles will disappear instantly if they touch this area.
Definition: particle_zone.hpp:60
Base class for all dynamic/moving game objects.
Definition: moving_object.hpp:35
ParticleZoneType
Definition: particle_zone.hpp:50
bool get_enabled() const
Returns whether or not particles can spawn in this area.
Definition: particle_zone.hpp:70
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: moving_object.hpp:49
void set_particle_name(std::string &particle_name)
Sets the name of the particle object for this area.
Definition: particle_zone.hpp:73
virtual GameObjectTypes get_types() const override
Get all types of the object, if available.
Definition: particle_zone.cpp:58
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
Returns the target X position of the zone.
Definition: particle_zone.hpp:102
Definition: reader_mapping.hpp:32
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: particle_zone.cpp:70
virtual bool has_variable_size() const override
Does this object have variable size (secret area trigger, wind, etc.)
Definition: particle_zone.hpp:35
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