17 #ifndef HEADER_SUPERTUX_OBJECT_ROCK_HPP 18 #define HEADER_SUPERTUX_OBJECT_ROCK_HPP 20 #include "object/moving_sprite.hpp" 21 #include "object/portable.hpp" 22 #include "supertux/physic.hpp" 28 Rock(
const ReaderMapping& reader,
const std::string& spritename =
"images/objects/rock/rock.sprite");
29 Rock(
const Vector& pos,
const std::string& spritename =
"images/objects/rock/rock.sprite");
33 virtual void update(
float dt_sec)
override;
35 virtual void grab(
MovingObject&
object,
const Vector& pos, Direction dir)
override;
36 virtual void ungrab(
MovingObject&
object, Direction dir)
override;
38 static std::string class_name() {
return "rock"; }
39 virtual std::string get_class_name()
const override {
return class_name(); }
40 static std::string display_name() {
return _(
"Rock"); }
45 virtual GameObjectTypes
get_types()
const override;
46 std::string get_default_sprite_name()
const override;
50 Physic& get_physic() {
return physic; }
63 std::string on_grab_script;
64 std::string on_ungrab_script;
65 bool running_grab_script;
66 bool running_ungrab_script;
70 Rock& operator=(
const Rock&) =
delete;
virtual void add_wind_velocity(const Vector &velocity, const Vector &end_speed)
Adds velocity from wind.
Definition: rock.cpp:285
virtual HitResponse collision(GameObject &other, const CollisionHit &hit) override
this function is called when the object collided with any other object
Definition: rock.cpp:163
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: rock.cpp:94
Physics engine.
Definition: physic.hpp:27
virtual GameObjectTypes get_types() const override
Get all types of the object, if available.
Definition: rock.cpp:73
An object that inherits from this object is considered "portable" and can be carried around by the pl...
Definition: portable.hpp:29
Definition: object_settings.hpp:39
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
Base class for all dynamic/moving game objects.
Definition: moving_object.hpp:35
virtual void collision_solid(const CollisionHit &hit) override
this function is called when the object collided with something solid
Definition: rock.cpp:135
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: rock.hpp:41
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
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: rock.hpp:42
virtual void grab(MovingObject &object, const Vector &pos, Direction dir) override
called each frame when the object has been grabbed.
Definition: rock.cpp:227
Definition: reader_mapping.hpp:32
Abstract base class for ""MovingObject""s, that are represented by a sprite.
Definition: moving_sprite.hpp:33
This class collects data about a collision.
Definition: collision_hit.hpp:44