17 #ifndef HEADER_SUPERTUX_SUPERTUX_MOVING_OBJECT_HPP 18 #define HEADER_SUPERTUX_SUPERTUX_MOVING_OBJECT_HPP 20 #include "collision/collision_hit.hpp" 21 #include "collision/collision_object.hpp" 22 #include "collision/collision_listener.hpp" 23 #include "math/rectf.hpp" 24 #include "supertux/game_object.hpp" 55 virtual void set_pos(
const Vector& pos)
60 virtual void move_to(
const Vector& pos)
65 virtual bool listener_is_valid()
const override {
return is_valid(); }
72 const Rectf& get_bbox()
const 77 const Vector& get_movement()
const 82 CollisionGroup get_group()
const 95 virtual std::string get_class()
const override {
return "moving-object"; }
101 void set_group(CollisionGroup group)
CollisionGroup m_group
The collision group.
Definition: collision_object.hpp:126
Vector m_movement
The movement that will happen till next frame.
Definition: collision_object.hpp:123
virtual void collision_solid(const CollisionHit &) override
this function is called when the object collided with something solid
Definition: moving_object.hpp:42
Simple two dimensional vector.
Definition: vector.hpp:24
Definition: collision_listener.hpp:23
void move_to(const Vector &pos)
moves entire object to a specific position, including all points those the object has...
Definition: collision_object.hpp:79
Definition: object_settings.hpp:35
Definition: collision_system.hpp:32
Rectf m_bbox
The bounding box of the object (as used for collision detection, this isn't necessarily the bounding ...
Definition: collision_object.hpp:120
Represents one of (potentially) multiple, separate parts of a Level.
Definition: sector.hpp:49
void set_pos(const Vector &pos)
places the moving object at a specific position.
Definition: collision_object.hpp:65
bool is_valid() const
returns true if the object is not scheduled to be removed yet
Definition: game_object.hpp:99
Base class for all the things that make up Levels' Sectors.
Definition: game_object.hpp:46
virtual void collision_tile(uint32_t) override
called when tiles with special attributes have been touched
Definition: moving_object.hpp:51
Base class for all dynamic/moving game objects.
Definition: moving_object.hpp:31
Definition: collision_object.hpp:30
virtual bool collides(GameObject &, const CollisionHit &) const override
when 2 objects collided, we will first call the pre_collision_check functions of both objects that ca...
Definition: moving_object.hpp:46
virtual void editor_select() override
The user clicked on the object in the editor and selected it.
Definition: moving_object.cpp:54
Definition: reader_mapping.hpp:31
This class collects data about a collision.
Definition: collision_hit.hpp:44