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"
10 #include "object/player.h"
11 #include "serializable.h"
12 #include "resources.h"
14 #include "direction.h"
15 #include "object_factory.h"
16 #include "lisp/parser.h"
17 #include "lisp/lisp.h"
18 #include "lisp/writer.h"
19 #include "video/drawing_context.h"
20 #include "special/sprite_manager.h"
22 using namespace SuperTux;
24 class BadGuy : public MovingObject, public Serializable
30 //virtual void action_activated(float elapsed_time);
32 virtual void draw(DrawingContext& context);
33 virtual void action(float elapsed_time);
34 virtual HitResponse collision(GameObject& other,
35 const CollisionHit& hit);
37 virtual void kill_fall();
39 Vector get_start_position() const
41 return start_position;
43 void set_start_position(const Vector& vec)
57 virtual HitResponse collision_player(Player& player,
58 const CollisionHit& hit);
59 virtual HitResponse collision_solid(GameObject& other,
60 const CollisionHit& hit);
61 virtual HitResponse collision_badguy(BadGuy& other,
62 const CollisionHit& hit);
64 virtual bool collision_squished(Player& player);
66 virtual void active_action(float elapsed_time);
67 virtual void inactive_action(float elapsed_time);
70 * called when the badguy has been activated. (As a side effect the dir
71 * variable might have been changed so that it faces towards the player.
73 virtual void activate();
74 /** caleed when the badguy has been deactivated */
75 virtual void deactivate();
77 void kill_squished(Player& player);
79 void set_state(State state);
80 State get_state() const
84 * returns a pointer to the player, try to avoid this function to avoid
85 * problems later when we have multiple players or no player in scripted
93 /// is the enemy activated
96 * initial position of the enemy. Also the position where enemy respawns when
97 * after being deactivated.
101 Vector start_position;