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

60 lines
1.3 KiB
C
Raw Permalink Normal View History

#include "system/vga.h"
#include "const.h"
2024-03-01 12:55:01 +00:00
int difficultyBands[MAX_DIFFICULTY];
2024-03-02 01:40:51 +00:00
int hitPointRanges[MAX_DIFFICULTY][4];
2024-03-04 22:38:03 +00:00
int damageUpgradeCosts[3] = { 5, 11, 18 };
int healthUpgradeCosts[3] = { 4, 9, 15 };
int healthGainUpgradeCosts[3] = { 6, 13, 21 };
2024-03-01 12:55:01 +00:00
struct SpriteBounds bounds;
// TODO: centralize these outside of game.c
struct CompiledSpriteRender rabbit,
mouse,
bullet,
enemy,
enemyBullet,
shotgun,
2024-03-02 01:40:51 +00:00
beam;
2024-03-01 12:55:01 +00:00
void buildDifficultyBands() {
int i;
2024-03-04 22:38:03 +00:00
float current = 0;
float increaseBy = BASE_KILLS;
2024-03-01 12:55:01 +00:00
for (i = 0; i < MAX_DIFFICULTY; ++i) {
2024-03-04 22:38:03 +00:00
current += increaseBy;
2024-03-01 12:55:01 +00:00
difficultyBands[i] = (int)current;
2024-03-04 22:38:03 +00:00
increaseBy *= KILLS_NEEDED_FOR_NEXT_LEVEL_MULTIPLIER;
2024-03-01 12:55:01 +00:00
}
}
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++;
2024-03-02 01:40:51 +00:00
if (countOfCurrent == HIT_POINT_DIFFICULTY_INCREASE_DELAY) {
2024-03-01 12:55:01 +00:00
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;
}
}
}
}
};