Finish main menu screen

This commit is contained in:
2024-02-12 17:18:37 +01:00
parent 10c6d74e90
commit abaa778aab
9 changed files with 759 additions and 491 deletions

View File

@@ -4,15 +4,40 @@
#include "entity_factory.h"
#include "utils.h"
WaveInfo getWaveInfo(i32 idx) {
#define NUM_WAVES 5
EnemyWaves getDefaultWaves() {
static WaveData waves[NUM_WAVES] = {
{ 10, 1.0f, 20, 2.0f, 0, 5 * 60 },
{ 20, 1.0f, 40, 2.0f, 0, 2 * 60 },
{ 25, 1.0f, 80, 2.2f, 0, 2 * 60 },
{ 50, 1.2f, 120, 3.0f, 0, 1.5f * 60 },
{ 100, 2.0f, 220, 4.0f, 0, 1.0f * 60 },
};
return (EnemyWaves) {
.numWaves = NUM_WAVES,
.waves = waves
};
}
EnemyWaves getMainMenuWaves() {
static WaveData waves[1] = {
{ 100000, 0.2f, 2000000, 0.8f, 0, 0 }
};
return (EnemyWaves) {
.numWaves = 1,
.waves = waves
};
}
WaveInfo getWaveInfo(const EnemyWaves *waves, i32 idx) {
BZ_ASSERT(idx >= 0);
WaveData waveData;
if (idx >= NUM_WAVES) {
waveData = predefWaves[NUM_WAVES - 1];
waveData.difficultyScale += (idx - NUM_WAVES) * 0.1f;
if (idx >= waves->numWaves) {
waveData = waves->waves[waves->numWaves - 1];
waveData.difficultyScale += (idx - waves->numWaves) * 0.1f;
} else {
waveData = predefWaves[idx];
waveData = waves->waves[idx];
}
WaveInfo info = {