17 #ifndef HEADER_SUPERTUX_BADGUY_WALKING_BADGUY_HPP 18 #define HEADER_SUPERTUX_BADGUY_WALKING_BADGUY_HPP 20 #include "badguy/badguy.hpp" 38 const std::string& sprite_name,
39 const std::string& walk_left_action,
40 const std::string& walk_right_action,
41 int layer = LAYER_OBJECTS,
42 const std::string& light_sprite_name =
"images/objects/lightmap_light/lightmap_light-medium.sprite");
44 const std::string& sprite_name,
45 const std::string& walk_left_action,
46 const std::string& walk_right_action,
47 int layer = LAYER_OBJECTS,
48 const std::string& light_sprite_name =
"images/objects/lightmap_light/lightmap_light-medium.sprite");
50 const std::string& sprite_name,
51 const std::string& walk_left_action,
52 const std::string& walk_right_action,
53 int layer = LAYER_OBJECTS,
54 const std::string& light_sprite_name =
"images/objects/lightmap_light/lightmap_light-medium.sprite");
61 virtual void freeze()
override;
62 virtual void unfreeze(
bool melt =
true)
override;
64 void active_update(
float dt_sec,
float target_velocity,
float modifier = 1.f);
68 float get_velocity_x()
const {
return m_physic.get_velocity_x(); }
69 float get_velocity_y()
const {
return m_physic.get_velocity_y(); }
70 void set_velocity_y(
float vy);
75 float get_walk_speed()
const {
return walk_speed; }
76 void set_walk_speed (
float);
86 static const int s_normal_max_drop_height = 600;
89 std::string walk_left_action;
90 std::string walk_right_action;
93 Timer turn_around_timer;
95 bool m_stay_on_platform_overridden;
int turn_around_counter
counts number of turns since turn_around_timer was started
Definition: walking_badguy.hpp:94
LedgeBehavior
Definition: walking_badguy.hpp:28
Base class for moving sprites that can hurt the Player.
Definition: badguy.hpp:38
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: badguy.hpp:71
Fall off any ledge, unless the ledge is too tall (600px) or the ledge falls offscreen.
virtual void collision_solid(const CollisionHit &hit) override
Called when the badguy collided with solid ground.
Definition: walking_badguy.cpp:180
void set_ledge_behavior(LedgeBehavior behavior)
Set max_drop_height depending on the given behavior.
Definition: walking_badguy.cpp:93
bool is_active() const
Returns true if we were in STATE_ACTIVE at the beginning of the last call to update() ...
Definition: badguy.cpp:879
virtual GameObjectClasses get_class_types() const override
List notable classes in inheritance hierarchy of class.
Definition: walking_badguy.hpp:55
virtual void active_update(float dt_sec) override
called each frame when the badguy is activated.
Definition: walking_badguy.cpp:174
virtual HitResponse collision_badguy(BadGuy &badguy, const CollisionHit &hit) override
Called when the badguy collided with another badguy.
Definition: walking_badguy.cpp:207
Base class for Badguys that walk on the floor.
Definition: walking_badguy.hpp:25
virtual void freeze() override
Called when hit by an ice bullet, and is_freezable() returns true.
Definition: walking_badguy.cpp:246
Do not fall off any ledge at all.
void add_velocity(const Vector &velocity)
Adds velocity to the badguy (be careful when using this)
Definition: walking_badguy.cpp:116
Do not fall off any ledge, but still go down slopes.
virtual void initialize() override
called immediately before the first call to initialize
Definition: walking_badguy.cpp:76
void override_stay_on_platform()
used by objects that should make badguys not turn around when they are walking on them ...
Definition: walking_badguy.hpp:66
virtual void unfreeze(bool melt=true) override
Called to unfreeze the badguy.
Definition: walking_badguy.cpp:252
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
Simple timer designed to be used in the update functions of objects.
Definition: timer.hpp:24
Definition: reader_mapping.hpp:32
int max_drop_height
Maximum height of drop before we will turn around, or -1 to just drop from any ledge.
Definition: walking_badguy.hpp:92
This class collects data about a collision.
Definition: collision_hit.hpp:44