- fixed bomb-dup bug (vector increases on add, and this changes I guess, so remove...
[supertux.git] / src / special.h
1 //  $Id$
2 //
3 //  SuperTux -  A Jump'n Run
4 //  Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
5 //
6 //  This program is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU General Public License
8 //  as published by the Free Software Foundation; either version 2
9 //  of the License, or (at your option) any later version.
10 //
11 //  This program is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //  GNU General Public License for more details.
15 //
16 //  You should have received a copy of the GNU General Public License
17 //  along with this program; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19
20 #define BULLET_STARTING_YM 1
21 #define BULLET_XM 5
22
23 #ifndef SUPERTUX_SPECIAL_H
24 #define SUPERTUX_SPECIAL_H
25
26 #include <SDL.h>
27 #include "bitmask.h"
28 #include "type.h"
29 #include "texture.h"
30 #include "collision.h"
31 #include "player.h"
32 #include "physic.h"
33
34 /* Upgrade types: */
35
36 enum UpgradeKind {
37   UPGRADE_GROWUP,
38   UPGRADE_ICEFLOWER,
39   UPGRADE_HERRING,
40   UPGRADE_1UP
41 };
42
43 void load_special_gfx();
44 void free_special_gfx();
45
46 class Upgrade
47 {
48 public:
49   UpgradeKind kind;
50   Direction  dir;
51   base_type base;
52   base_type old_base;
53   Physic physic;
54
55   void init(float x, float y, Direction dir, UpgradeKind kind);
56   void action(double frame_ratio);
57   void draw();
58   void collision(void* p_c_object, int c_object);
59
60 private:
61   /** removes the Upgrade from the global upgrade list. Note that after this
62    * call the class doesn't exist anymore! So don't use any member variables
63    * anymore then
64    */
65   void remove_me();
66 };
67
68 class Bullet
69 {
70  public:
71   base_type base;
72   base_type old_base;
73   
74   void init(float x, float y, float xm, Direction dir);
75   void action(double frame_ratio);
76   void draw();
77   void collision(int c_object);
78
79 private:
80   /** removes the Upgrade from the global upgrade list. Note that after this
81    * call the class doesn't exist anymore! So don't use any member variables
82    * anymore then
83    */
84   void remove_me();
85 };
86
87 #endif /*SUPERTUX_SPECIAL_H*/