/*bm_bsod = img_bsod_left[0];*/
}
-void badguy_init(bad_guy_type* pbad, float x, float y, int kind)
+void badguy_init(bad_guy_type* pbad, float x, float y, BadGuyKind kind)
{
- pbad->base.width = 32;
+ pbad->base.width = 32;
pbad->base.height = 32;
- pbad->mode = NORMAL;
- pbad->dying = DYING_NOT;
- pbad->kind = kind;
- pbad->base.x = x;
- pbad->base.y = y;
- pbad->base.xm = 1.3;
- pbad->base.ym = 4.8;
+ pbad->mode = NORMAL;
+ pbad->dying = DYING_NOT;
+ pbad->kind = kind;
+ pbad->base.x = x;
+ pbad->base.y = y;
+ pbad->base.xm = 1.3;
+ pbad->base.ym = 4.8;
pbad->old_base = pbad->base;
- pbad->dir = LEFT;
- pbad->seen = false;
+ pbad->dir = LEFT;
+ pbad->seen = false;
timer_init(&pbad->timer, true);
physic_init(&pbad->physic);
}
#include "collision.h"
/* Enemy modes: */
-
#define NORMAL 0
#define FLAT 1
#define KICK 2
#define HELD 3
-/* Badguy type: */
+/* Bad guy kinds: */
+enum BadGuyKind {
+ BAD_BSOD,
+ BAD_LAPTOP,
+ BAD_MONEY
+};
+/* Badguy type: */
struct bad_guy_type
{
int mode;
DyingType dying;
- int kind;
+ BadGuyKind kind;
bool seen;
int dir;
int frame;
physic_type physic;
};
-/* Bad guy kinds: */
-
-enum {
- BAD_BSOD,
- BAD_LAPTOP,
- BAD_MONEY
-};
-
extern texture_type img_bsod_squished_left;
extern texture_type img_bsod_squished_right;
extern texture_type img_bsod_falling_left;
void badguy_create_bitmasks();
-void badguy_init(bad_guy_type* pbad, float x, float y, int kind);
+void badguy_init(bad_guy_type* pbad, float x, float y, BadGuyKind kind);
void badguy_action(bad_guy_type* pbad);
void badguy_draw(bad_guy_type* pbad);
{
if (current_level.tiles[y][x] >= '0' && current_level.tiles[y][x] <= '9')
{
- add_bad_guy(x * 32, y * 32, current_level.tiles[y][x] - '0');
+ add_bad_guy(x * 32, y * 32, static_cast<BadGuyKind>(current_level.tiles[y][x] - '0'));
current_level.tiles[y][x] = '.';
}
}
for (y = 0; y < 15; ++y)
for (x = 0; x < le_current_level->width; ++x)
if (le_current_level->tiles[y][x] >= '0' && le_current_level->tiles[y][x] <= '9')
- add_bad_guy(x * 32, y * 32, le_current_level->tiles[y][x] - '0');
+ add_bad_guy(x * 32, y * 32, static_cast<BadGuyKind>(le_current_level->tiles[y][x] - '0'));
}
void le_set_defaults()
/* Add a bad guy: */
-void add_bad_guy(float x, float y, int kind)
+void add_bad_guy(float x, float y, BadGuyKind kind)
{
bad_guy_type new_bad_guy;
badguy_init(&new_bad_guy,x,y,kind);
void add_broken_brick(float x, float y);
void add_broken_brick_piece(float x, float y, float xm, float ym);
void add_bouncy_brick(float x, float y);
-void add_bad_guy(float x, float y, int kind);
+void add_bad_guy(float x, float y, BadGuyKind kind);
void add_upgrade(float x, float y, int dir, int kind);
void add_bullet(float x, float y, float xm, int dir);