17 #ifndef HEADER_SUPERTUX_OBJECT_LIT_OBJECT_HPP 18 #define HEADER_SUPERTUX_OBJECT_LIT_OBJECT_HPP 20 #include "object/moving_sprite.hpp" 33 static void register_class(ssq::VM& vm);
39 virtual void update(
float)
override;
43 static std::string class_name() {
return "lit-object"; }
44 virtual std::string get_class_name()
const override {
return class_name(); }
45 virtual std::string get_exposed_class_name()
const override {
return "LitObject"; }
46 static std::string display_name() {
return _(
"Lit object"); }
51 virtual void after_editor_set()
override;
53 virtual int get_layer()
const override {
return m_layer; }
55 virtual void on_flip(
float height)
override;
70 Vector m_light_offset;
71 std::string m_light_sprite_name;
72 std::string m_sprite_action;
73 std::string m_light_sprite_action;
74 SpritePtr m_light_sprite;
void set_light_action(const std::string &action)
Sets the light sprite action.
Definition: lit_object.cpp:108
int m_layer
Sprite's z-position.
Definition: moving_sprite.hpp:153
Definition: object_settings.hpp:39
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: lit_object.hpp:48
std::string get_light_action() const
Returns the current light sprite action.
Definition: lit_object.cpp:102
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: lit_object.hpp:47
virtual HitResponse collision(GameObject &, const CollisionHit &) override
this function is called when the object collided with any other object
Definition: lit_object.hpp:41
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: lit_object.cpp:54
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: moving_sprite.hpp:60
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
A ""LitObject"" that was given a name can be controlled by scripts.
Definition: lit_object.hpp:30
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
Definition: reader_mapping.hpp:32
Abstract base class for ""MovingObject""s, that are represented by a sprite.
Definition: moving_sprite.hpp:33
virtual void update(float) override
This function is called once per frame and allows the object to update it's state.
Definition: lit_object.cpp:61
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
virtual void on_flip(float height) override
When level is flipped vertically.
Definition: lit_object.cpp:95