17 #ifndef HEADER_SUPERTUX_OBJECT_COIN_HPP 18 #define HEADER_SUPERTUX_OBJECT_COIN_HPP 20 #include "object/path_object.hpp" 21 #include "object/moving_sprite.hpp" 22 #include "supertux/physic.hpp" 34 Coin(
const Vector& pos,
bool count_stats =
true,
35 const std::string& sprite_path =
"images/objects/coin/coin.sprite");
41 virtual void update(
float dt_sec)
override;
42 static std::string class_name() {
return "coin"; }
43 virtual std::string get_class_name()
const override {
return class_name(); }
44 static std::string display_name() {
return _(
"Coin"); }
49 GameObjectTypes
get_types()
const override;
50 std::string get_default_sprite_name()
const override;
52 virtual void after_editor_set()
override;
56 void check_state()
override;
58 virtual void move_to(
const Vector& pos)
override;
60 virtual void on_flip(
float height)
override;
75 std::string m_collect_script;
79 const bool m_count_stats;
83 Coin& operator=(
const Coin&) =
delete;
89 HeavyCoin(
const Vector& pos,
const Vector& init_velocity,
bool count_stats =
true,
90 const std::string& sprite_path =
"images/objects/coin/coin.sprite");
93 virtual void update(
float dt_sec)
override;
96 static std::string class_name() {
return "heavycoin"; }
97 virtual std::string get_class_name()
const override {
return class_name(); }
98 static std::string display_name() {
return _(
"Heavy Coin"); }
103 virtual void after_editor_set()
override;
105 virtual void on_flip(
float height)
override;
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: coin.hpp:100
GameObjectTypes get_types() const override
Get all types of the object, if available.
Definition: coin.cpp:66
A walker that travels along a path.
Definition: path_walker.hpp:31
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: coin.hpp:45
virtual void editor_update() override
Called each frame in the editor, used to keep linked objects together (e.g.
Definition: coin.cpp:124
virtual void collision_solid(const CollisionHit &) override
this function is called when the object collided with something solid
Definition: moving_object.hpp:51
Physics engine.
Definition: physic.hpp:27
Definition: object_settings.hpp:39
void save_state() override
Save/check the current state of the object.
Definition: coin.cpp:144
virtual HitResponse collision(GameObject &other, const CollisionHit &hit) override
this function is called when the object collided with any other object
Definition: coin.cpp:237
virtual void finish_construction() override
Called after all objects have been added to the Sector and the Sector is fully constructed.
Definition: coin.cpp:87
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: moving_sprite.hpp:60
virtual void on_flip(float height) override
When level is flipped vertically.
Definition: coin.cpp:359
This class is responsible for: Updating and drawing the object.
Definition: game_object.hpp:83
A base class for all objects that contain, or make use of a path.
Definition: path_object.hpp:36
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
This class is responsible for managing an array of tiles.
Definition: tilemap.hpp:49
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: coin.cpp:102
Abstract base class for ""MovingObject""s, that are represented by a sprite.
Definition: moving_sprite.hpp:33
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: coin.hpp:99
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: coin.hpp:46
This class collects data about a collision.
Definition: collision_hit.hpp:44