17 #ifndef HEADER_SUPERTUX_TRIGGER_DOOR_HPP 18 #define HEADER_SUPERTUX_TRIGGER_DOOR_HPP 20 #include "trigger/trigger_base.hpp" 22 #include "supertux/timer.hpp" 29 static std::string class_name() {
return "door"; }
30 virtual std::string get_class_name()
const override {
return class_name(); }
31 static std::string display_name() {
return _(
"Door"); }
36 virtual void after_editor_set()
override;
38 virtual void update(
float dt_sec)
override;
44 virtual void on_flip(
float height)
override;
46 bool is_locked()
const {
return m_locked; }
49 Color get_lock_color()
const {
return m_lock_color; }
63 std::string m_target_sector;
64 std::string m_target_spawnpoint;
66 SpritePtr m_lock_sprite;
67 Timer m_stay_open_timer;
68 Timer m_unlocking_timer;
69 Timer m_lock_warn_timer;
72 bool m_transition_triggered;
73 Player* m_triggering_player;
77 Door& operator=(
const Door&) =
delete;
EventType
Definition: trigger_base.hpp:34
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: door.cpp:164
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: door.cpp:99
Definition: trigger_base.hpp:90
virtual HitResponse collision(GameObject &other, const CollisionHit &hit) override
this function is called when the object collided with any other object
Definition: door.cpp:206
Definition: object_settings.hpp:39
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: door.hpp:33
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: trigger_base.hpp:95
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
virtual void on_flip(float height) override
When level is flipped vertically.
Definition: door.cpp:252
virtual void event(Player &player, EventType type) override
Receive trigger events.
Definition: door.cpp:178
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
Simple timer designed to be used in the update functions of objects.
Definition: timer.hpp:24
Definition: reader_mapping.hpp:32
This module contains methods controlling the player.
Definition: player.hpp:47
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: door.hpp:32
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