Clear drawBullet list when battle starts.

This commit is contained in:
Steve 2015-12-11 19:10:27 +00:00
parent 14aba69da8
commit 25f2204d06
4 changed files with 11 additions and 1 deletions

View File

@ -1,4 +1,4 @@
VERSION = 0.4 VERSION = 0.41
REVISION = $(shell date +"%y%m%d") REVISION = $(shell date +"%y%m%d")
DEBUG = 0 DEBUG = 0

View File

@ -52,6 +52,8 @@ void initBattle(void)
initStars(); initStars();
initBullets();
initBackground(); initBackground();
initEffects(); initEffects();

View File

@ -72,6 +72,7 @@ extern void initMessageBox(void);
extern void doMessageBox(void); extern void doMessageBox(void);
extern void drawMessageBox(void); extern void drawMessageBox(void);
extern void resetMessageBox(void); extern void resetMessageBox(void);
extern void initBullets(void);
extern App app; extern App app;
extern Battle battle; extern Battle battle;

View File

@ -27,6 +27,13 @@ static Bullet bulletDef[BT_MAX];
static Bullet *bulletsToDraw[MAX_BULLETS_TO_DRAW]; static Bullet *bulletsToDraw[MAX_BULLETS_TO_DRAW];
static int incomingMissile; static int incomingMissile;
void initBullets(void)
{
incomingMissile = 0;
memset(bulletsToDraw, 0, sizeof(Bullet*) * MAX_BULLETS_TO_DRAW);
}
void initBulletDefs(void) void initBulletDefs(void)
{ {
cJSON *root, *node; cJSON *root, *node;