dos-vga-arena-shooter-game/const.c

74 lines
1.4 KiB
C

#include "system/vga.h"
#include "const.h"
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 }
};
struct SpriteBounds bounds;
// TODO: centralize these outside of game.c
struct CompiledSpriteRender rabbit,
mouse,
bullet,
enemy,
enemyBullet,
shotgun,
shieldKiller;
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;
}
}
}
}
};