07034c3c50d656a2a72ec9eb2f0d5966a72141ae
[supertux.git] / src / badguy.h
1 //
2 // Interface: badguy
3 //
4 // Description:
5 //
6 //
7 // Author: Tobias Glaesser <tobi.web@gmx.de> (C) 2003
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12
13 #ifndef SUPERTUX_BADGUY_H
14 #define SUPERTUX_BADGUY_H
15
16 #include "SDL.h"
17 #include "bitmask.h"
18 #include "type.h"
19 #include "timer.h"
20 #include "texture.h"
21 #include "physic.h"
22 #include "collision.h"
23
24 /* Enemy modes: */
25 #define NORMAL 0
26 #define FLAT 1
27 #define KICK 2
28 #define HELD 3
29
30 /* Bad guy kinds: */
31 enum BadGuyKind {
32   BAD_BSOD,
33   BAD_LAPTOP,
34   BAD_MONEY
35 };
36
37 /* Badguy type: */
38 struct bad_guy_type
39 {
40   int mode;
41   DyingType dying;
42   BadGuyKind kind;
43   bool seen;
44   int dir;
45   int frame;
46   base_type base;
47   base_type old_base;
48   timer_type timer;
49   physic_type physic;
50 };
51
52 extern texture_type img_bsod_squished_left;
53 extern texture_type img_bsod_squished_right;
54 extern texture_type img_bsod_falling_left;
55 extern texture_type img_bsod_falling_right;
56 extern texture_type img_laptop_flat_left;
57 extern texture_type img_laptop_flat_right;
58 extern texture_type img_laptop_falling_left;
59 extern texture_type img_laptop_falling_right;
60 extern texture_type img_bsod_left[4];
61 extern texture_type img_bsod_right[4];
62 extern texture_type img_laptop_left[3];
63 extern texture_type img_laptop_right[3];
64 extern texture_type img_money_left[2];
65 extern texture_type img_money_right[2];
66
67 extern bitmask *bm_bsod;
68
69 void badguy_create_bitmasks();
70
71 void badguy_init(bad_guy_type* pbad, float x, float y, BadGuyKind kind);
72
73 void badguy_action(bad_guy_type* pbad);
74 void badguy_draw(bad_guy_type* pbad);
75
76 void badguy_action_bsod(bad_guy_type* pbad);
77 void badguy_action_laptop(bad_guy_type* pbad);
78 void badguy_action_money(bad_guy_type* pbad);
79
80 void badguy_draw_bsod(bad_guy_type* pbad);
81 void badguy_draw_laptop(bad_guy_type* pbad);
82 void badguy_draw_money(bad_guy_type* pbad);
83
84 void badguy_collision(bad_guy_type* pbad, void* p_c_object, int c_object);
85
86 #endif /*SUPERTUX_BADGUY_H*/
87
88