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

53 lines
1.1 KiB
C

#include "system/vga.h"
#include "const.h"
int difficultyBands[MAX_DIFFICULTY];
int hitPointRanges[MAX_DIFFICULTY][4];
struct SpriteBounds bounds;
// TODO: centralize these outside of game.c
struct CompiledSpriteRender rabbit,
mouse,
bullet,
enemy,
enemyBullet,
shotgun,
beam;
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 == HIT_POINT_DIFFICULTY_INCREASE_DELAY) {
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;
}
}
}
}
};