quick fix for bug introduced by the last commit
[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 extern texture_type img_bsod_squished_left;
31 extern texture_type img_bsod_squished_right;
32 extern texture_type img_bsod_falling_left;
33 extern texture_type img_bsod_falling_right;
34 extern texture_type img_laptop_flat_left;
35 extern texture_type img_laptop_flat_right;
36 extern texture_type img_laptop_falling_left;
37 extern texture_type img_laptop_falling_right;
38 extern texture_type img_bsod_left[4];
39 extern texture_type img_bsod_right[4];
40 extern texture_type img_laptop_left[3];
41 extern texture_type img_laptop_right[3];
42 extern texture_type img_money_left[2];
43 extern texture_type img_money_right[2];
44
45 /* Bad guy kinds: */
46 enum BadGuyKind {
47   BAD_BSOD,
48   BAD_LAPTOP,
49   BAD_MONEY
50 };
51
52 BadGuyKind  badguykind_from_string(const std::string& str);
53 std::string badguykind_to_string(BadGuyKind kind);
54
55 struct BadGuyData
56 {
57   BadGuyKind kind;
58   int x;
59   int y;
60
61   BadGuyData(BadGuyKind kind_, int x_, int y_) 
62     : kind(kind_), x(x_), y(y_) {}
63
64   BadGuyData()
65     : kind(BAD_BSOD), x(0), y(0) {}
66 };
67
68 /* Badguy type: */
69 class BadGuy
70 {
71  public:
72   int mode;
73   DyingType dying;
74   BadGuyKind kind;
75   bool seen;
76   int dir;
77   base_type base;
78   base_type old_base;
79   timer_type timer;
80   physic_type physic;
81
82  public:
83   void init(float x, float y, BadGuyKind kind);
84
85   void action();
86   void draw();
87
88   void action_bsod();
89   void draw_bsod();
90
91   void action_laptop();
92   void draw_laptop();
93    
94   void action_money(); 
95   void draw_money();
96
97   void collision(void* p_c_object, int c_object);
98 };
99
100 #endif /*SUPERTUX_BADGUY_H*/
101
102