00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef HEADER_SUPERTUX_BADGUY_WALKING_BADGUY_HPP
00018 #define HEADER_SUPERTUX_BADGUY_WALKING_BADGUY_HPP
00019
00020 #include "badguy/badguy.hpp"
00021
00022 class Timer;
00023
00027 class WalkingBadguy : public BadGuy
00028 {
00029 public:
00030 WalkingBadguy(const Vector& pos,
00031 const std::string& sprite_name,
00032 const std::string& walk_left_action,
00033 const std::string& walk_right_action,
00034 int layer = LAYER_OBJECTS);
00035 WalkingBadguy(const Vector& pos, Direction direction,
00036 const std::string& sprite_name,
00037 const std::string& walk_left_action,
00038 const std::string& walk_right_action,
00039 int layer = LAYER_OBJECTS);
00040 WalkingBadguy(const Reader& reader,
00041 const std::string& sprite_name,
00042 const std::string& walk_left_action,
00043 const std::string& walk_right_action,
00044 int layer = LAYER_OBJECTS);
00045
00046 void initialize();
00047 void active_update(float elapsed_time);
00048 void active_update(float elapsed_time, float target_velocity);
00049 void collision_solid(const CollisionHit& hit);
00050 HitResponse collision_badguy(BadGuy& badguy, const CollisionHit& hit);
00051 void freeze();
00052 void unfreeze();
00053
00054 float get_velocity_y() const;
00055 void set_velocity_y(float vy);
00056
00060 void add_velocity(const Vector& velocity);
00061
00062 float get_walk_speed (void) const
00063 {
00064 return (walk_speed);
00065 }
00066 void set_walk_speed (float);
00067
00068 protected:
00069 void turn_around();
00070
00071 protected:
00072 std::string walk_left_action;
00073 std::string walk_right_action;
00074 float walk_speed;
00075 int max_drop_height;
00076 Timer turn_around_timer;
00077 int turn_around_counter;
00078 };
00079
00080 #endif
00081
00082