Fix wave notification text
This commit is contained in:
@@ -4,11 +4,12 @@
|
||||
#include "entity_factory.h"
|
||||
#include "utils.h"
|
||||
|
||||
#define NUM_WAVES 14
|
||||
#define NUM_WAVES 15
|
||||
|
||||
EnemyWaves getDefaultWaves() {
|
||||
static WaveData waves[NUM_WAVES] = {
|
||||
{ 0, 0.0f, 5, 1.0f, 0, 8 * 60 },
|
||||
{ 0, 0.0f, 0, 0.0f, 0, 0}, // Dummy wave
|
||||
{ 0, 0.0f, 5, 1.0f, 0, 8 * 60},
|
||||
{ 0, 0.0f, 20, 2.0f, 0, 3 * 60 },
|
||||
{ 5, 0.2f, 30, 2.2f, 0, 60 },
|
||||
{ 10, 0.5f, 40, 2.4f, 0, 40 },
|
||||
@@ -75,7 +76,7 @@ void updateWave(WaveInfo *wave, Game *game, f32 dt) {
|
||||
wave->goblinsElapsed += dt;
|
||||
|
||||
f32 timeForGoblin = 1.0f / wave->data.goblinSendRate;
|
||||
while (wave->goblinsElapsed >= timeForGoblin) {
|
||||
while (wave->goblinsToSend > 0 && wave->goblinsElapsed >= timeForGoblin) {
|
||||
Vector2 spawnPos = randomizeSpawnPos(game->swarmSpawn, 20);
|
||||
entityCreate(ENTITY_GOBLIN, spawnPos, PLAYER_ENEMY, game);
|
||||
wave->goblinsElapsed -= timeForGoblin;
|
||||
@@ -83,7 +84,7 @@ void updateWave(WaveInfo *wave, Game *game, f32 dt) {
|
||||
}
|
||||
|
||||
f32 timeForOrc = 1.0f / wave->data.orcSendRate;
|
||||
while (wave->orcsElapsed >= timeForOrc) {
|
||||
while (wave->orcsToSend > 0 && wave->orcsElapsed >= timeForOrc) {
|
||||
Vector2 spawnPos = randomizeSpawnPos(game->swarmSpawn, 20);
|
||||
entityCreate(ENTITY_ORC, spawnPos, PLAYER_ENEMY, game);
|
||||
wave->orcsElapsed -= timeForOrc;
|
||||
|
||||
Reference in New Issue
Block a user