- added UpgradeKind name to nameless enum
[supertux.git] / src / special.h
1 //
2 // C Interface: special
3 //
4 // Description: 
5 //
6 //
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2004
8 //
9 // Copyright: See COPYING file that comes with this distribution
10 //
11 //
12
13 #define BULLET_STARTING_YM 1
14 #define BULLET_XM 5
15
16 #ifndef SUPERTUX_SPECIAL_H
17 #define SUPERTUX_SPECIAL_H
18
19 #include <SDL.h>
20 #include "bitmask.h"
21 #include "type.h"
22 #include "texture.h"
23 #include "collision.h"
24 #include "player.h"
25 #include "physic.h"
26
27 /* Upgrade types: */
28
29 enum UpgradeKind {
30   UPGRADE_GROWUP,
31   UPGRADE_ICEFLOWER,
32   UPGRADE_HERRING,
33   UPGRADE_1UP
34 };
35
36 void load_special_gfx();
37 void free_special_gfx();
38
39 class Upgrade
40 {
41 public:
42   UpgradeKind kind;
43   int dir;
44   base_type base;
45   base_type old_base;
46   Physic physic;
47
48   void init(float x, float y, int dir, UpgradeKind kind);
49   void action(double frame_ratio);
50   void draw();
51   void collision(void* p_c_object, int c_object);
52
53 private:
54   /** removes the Upgrade from the global upgrade list. Note that after this
55    * call the class doesn't exist anymore! So don't use any member variables
56    * anymore then
57    */
58   void remove_me();
59 };
60
61 class Bullet
62 {
63  public:
64   base_type base;
65   base_type old_base;
66   
67   void init(float x, float y, float xm, int dir);
68   void action(double frame_ratio);
69   void draw();
70   void collision(int c_object);
71
72 private:
73   /** removes the Upgrade from the global upgrade list. Note that after this
74    * call the class doesn't exist anymore! So don't use any member variables
75    * anymore then
76    */
77   void remove_me();
78 };
79
80 #endif /*SUPERTUX_SPECIAL_H*/