4 // moved them here to make it less typing when implementing new badguys
7 #include "special/moving_object.h"
8 #include "special/sprite.h"
9 #include "math/physic.h"
11 #include "serializable.h"
12 #include "resources.h"
14 #include "utils/lispwriter.h"
15 #include "utils/lispreader.h"
16 #include "video/drawing_context.h"
17 #include "special/sprite_manager.h"
19 using namespace SuperTux;
21 class BadGuy : public MovingObject, public Serializable
27 //virtual void action_activated(float elapsed_time);
29 virtual void draw(DrawingContext& context);
30 virtual void action(float elapsed_time);
31 virtual HitResponse collision(GameObject& other,
32 const CollisionHit& hit);
34 virtual void kill_fall();
45 virtual HitResponse collision_player(Player& player,
46 const CollisionHit& hit);
47 virtual HitResponse collision_solid(GameObject& other,
48 const CollisionHit& hit);
49 virtual HitResponse collision_badguy(BadGuy& other,
50 const CollisionHit& hit);
52 virtual bool collision_squished(Player& player);
54 virtual void active_action(float elapsed_time);
55 virtual void inactive_action(float elapsed_time);
58 * called when the badguy has been activated. (As a side effect the dir
59 * variable might have been changed so that it faces towards the player.
61 virtual void activate();
62 /** caleed when the badguy has been deactivated */
63 virtual void deactivate();
65 void kill_squished(Player& player);
67 void set_state(State state);
68 State get_state() const
72 * returns a pointer to the player, try to avoid this function to avoid
73 * problems later when we have multiple players or no player in scripted
81 /// is the enemy activated
84 * initial position of the enemy. Also the position where enemy respawns when
85 * after being deactivated.
89 Vector start_position;