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 "object_factory.h"
15 #include "lisp/parser.h"
16 #include "lisp/lisp.h"
17 #include "lisp/writer.h"
18 #include "video/drawing_context.h"
19 #include "special/sprite_manager.h"
21 using namespace SuperTux;
23 class BadGuy : public MovingObject, public Serializable
29 //virtual void action_activated(float elapsed_time);
31 virtual void draw(DrawingContext& context);
32 virtual void action(float elapsed_time);
33 virtual HitResponse collision(GameObject& other,
34 const CollisionHit& hit);
36 virtual void kill_fall();
47 virtual HitResponse collision_player(Player& player,
48 const CollisionHit& hit);
49 virtual HitResponse collision_solid(GameObject& other,
50 const CollisionHit& hit);
51 virtual HitResponse collision_badguy(BadGuy& other,
52 const CollisionHit& hit);
54 virtual bool collision_squished(Player& player);
56 virtual void active_action(float elapsed_time);
57 virtual void inactive_action(float elapsed_time);
60 * called when the badguy has been activated. (As a side effect the dir
61 * variable might have been changed so that it faces towards the player.
63 virtual void activate();
64 /** caleed when the badguy has been deactivated */
65 virtual void deactivate();
67 void kill_squished(Player& player);
69 void set_state(State state);
70 State get_state() const
74 * returns a pointer to the player, try to avoid this function to avoid
75 * problems later when we have multiple players or no player in scripted
83 /// is the enemy activated
86 * initial position of the enemy. Also the position where enemy respawns when
87 * after being deactivated.
91 Vector start_position;