17 #ifndef HEADER_SUPERTUX_OBJECT_CONVEYOR_BELT_HPP 18 #define HEADER_SUPERTUX_OBJECT_CONVEYOR_BELT_HPP 20 #include "object/moving_sprite.hpp" 22 #include "supertux/timer.hpp" 35 static void register_class(ssq::VM& vm);
44 static std::string class_name() {
return "conveyor-belt"; }
45 virtual std::string get_class_name()
const override {
return class_name(); }
46 virtual std::string get_exposed_class_name()
const override {
return "ConveyorBelt"; }
47 static std::string display_name() {
return _(
"Conveyor Belt"); }
51 virtual void update(
float dt_sec)
override;
54 virtual int get_layer()
const override {
return LAYER_TILES; }
56 virtual void after_editor_set()
override;
87 void update_hitbox()
override;
98 const float MAX_SPEED = 32.0f;
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: conveyor_belt.hpp:49
void stop()
Stops the conveyor belt.
Definition: conveyor_belt.cpp:146
virtual HitResponse collision(GameObject &other, const CollisionHit &hit) override
this function is called when the object collided with any other object
Definition: conveyor_belt.cpp:73
Definition: object_settings.hpp:39
void move_right()
Makes the conveyor shift objects to the right.
Definition: conveyor_belt.cpp:161
virtual void update(float dt_sec) override
This function is called once per frame and allows the object to update it's state.
Definition: conveyor_belt.cpp:82
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
void set_speed(float target_speed)
Change the shifting speed of the conveyor.
Definition: conveyor_belt.cpp:169
virtual std::string get_display_name() const override
Returns the display name of the object, translated to the user's locale.
Definition: conveyor_belt.hpp:48
virtual void draw(DrawingContext &context) override
The GameObject should draw itself onto the provided DrawingContext if this function is called...
Definition: conveyor_belt.cpp:107
void start()
Starts the conveyor belt.
Definition: conveyor_belt.cpp:139
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
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42
This class represents a platform that moves entities riding it.
Definition: conveyor_belt.hpp:32
void move_left()
Makes the conveyor shift objects to the left.
Definition: conveyor_belt.cpp:153
This class collects data about a collision.
Definition: collision_hit.hpp:44