#define BULLET_STARTING_YM 1
#define BULLET_XM 5
-#define NUM_BULLETS 3
#ifndef SUPERTUX_SPECIAL_H
#define SUPERTUX_SPECIAL_H
#include <SDL.h>
#include "bitmask.h"
#include "type.h"
+#include "texture.h"
#include "collision.h"
+#include "player.h"
-typedef struct upgrade_type
- {
- int alive;
- int kind;
- float x;
- float y;
- float xm;
- float ym;
- float width;
- float height;
- unsigned int updated;
- itop_type it;
- }
-upgrade_type;
+/* Upgrade types: */
-typedef struct bullet_type
- {
- int alive;
- float x;
- float y;
- float xm;
- float ym;
- float width;
- float height;
- unsigned int updated;
- itop_type it;
- }
-bullet_type;
+enum {
+ UPGRADE_MINTS,
+ UPGRADE_COFFEE,
+ UPGRADE_HERRING
+};
-texture_type img_bullet;
-bitmask* bm_bullet;
+class Upgrade
+{
+ public:
+ int kind;
+ base_type base;
+ base_type old_base;
-void create_special_bitmasks();
+ void init(float x, float y, int dir, int kind);
+ void action(double frame_ratio);
+ void draw();
+ void collision(void* p_c_object, int c_object);
+};
+
+class Bullet
+{
+ public:
+ base_type base;
+ base_type old_base;
+
+ void init(float x, float y, float xm, int dir);
+ void action(double frame_ratio);
+ void draw();
+ void collision(int c_object);
+};
-texture_type img_golden_herring;
+extern texture_type img_bullet;
+extern bitmask* bm_bullet;
-void upgrade_init(upgrade_type *pupgrade);
-void upgrade_action(upgrade_type *pupgrade);
-void upgrade_draw(upgrade_type *pupgrade);
-void upgrade_collision(upgrade_type *pupgrade, void* p_c_object, int c_object);
+void create_special_bitmasks();
-void bullet_init(bullet_type *pbullet);
-void bullet_action(bullet_type *pbullet);
-void bullet_draw(bullet_type *pbullet);
-void bullet_collision(bullet_type *pbullet, int c_object);
+extern texture_type img_golden_herring;
#endif /*SUPERTUX_SPECIAL_H*/