2024-03-01 02:29:23 +00:00
|
|
|
#include "system/vga.h"
|
|
|
|
#include "const.h"
|
|
|
|
|
2024-03-01 12:55:01 +00:00
|
|
|
int difficultyBands[MAX_DIFFICULTY];
|
|
|
|
int hitPointRanges[MAX_DIFFICULTY][4] = {
|
|
|
|
{ 1, 1, 1, 1 },
|
|
|
|
{ 1, 1, 1, 1 },
|
|
|
|
{ 1, 1, 1, 2 },
|
|
|
|
{ 1, 1, 1, 2 },
|
|
|
|
{ 1, 1, 2, 2 },
|
|
|
|
{ 1, 2, 2, 2 },
|
|
|
|
{ 1, 2, 2, 2 },
|
|
|
|
{ 1, 2, 2, 3 },
|
|
|
|
{ 1, 2, 2, 3 },
|
|
|
|
{ 1, 2, 3, 3 },
|
|
|
|
{ 1, 2, 3, 3 },
|
|
|
|
{ 1, 2, 3, 3 },
|
|
|
|
{ 1, 2, 3, 3 },
|
|
|
|
{ 1, 2, 3, 3 },
|
|
|
|
{ 1, 2, 3, 3 },
|
|
|
|
{ 1, 2, 3, 3 },
|
|
|
|
{ 1, 2, 3, 3 },
|
|
|
|
{ 1, 2, 3, 3 },
|
|
|
|
{ 1, 2, 3, 3 },
|
|
|
|
{ 1, 2, 3, 3 }
|
|
|
|
};
|
|
|
|
|
2024-03-01 02:29:23 +00:00
|
|
|
struct SpriteBounds bounds;
|
|
|
|
|
|
|
|
// TODO: centralize these outside of game.c
|
|
|
|
struct CompiledSpriteRender rabbit,
|
|
|
|
mouse,
|
|
|
|
bullet,
|
|
|
|
enemy,
|
|
|
|
enemyBullet,
|
|
|
|
shotgun,
|
|
|
|
shieldKiller;
|
2024-03-01 12:55:01 +00:00
|
|
|
|
|
|
|
void buildDifficultyBands() {
|
|
|
|
int i;
|
|
|
|
float current = BASE_KILLS;
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_DIFFICULTY; ++i) {
|
|
|
|
difficultyBands[i] = (int)current;
|
|
|
|
current *= KILLS_NEEDED_FOR_NEXT_LEVEL_MULTIPLIER;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void buildHitPointRages() {
|
|
|
|
int currentRange[4] = { 1, 1, 1, 1 };
|
|
|
|
int i, j, countOfCurrent = 0, tmp;
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_DIFFICULTY; ++i) {
|
|
|
|
for (j = 0; j < 4; ++j) {
|
|
|
|
hitPointRanges[i][j] = currentRange[j];
|
|
|
|
}
|
|
|
|
|
|
|
|
countOfCurrent++;
|
|
|
|
if (countOfCurrent == 2) {
|
|
|
|
countOfCurrent = 0;
|
|
|
|
|
|
|
|
currentRange[3]++;
|
|
|
|
|
|
|
|
for (j = 3; j > 0; --j) {
|
|
|
|
if (currentRange[j] > currentRange[j - 1]) {
|
|
|
|
tmp = currentRange[j - 1];
|
|
|
|
currentRange[j - 1] = currentRange[j];
|
|
|
|
currentRange[j] = tmp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|