private void waveGenerator() {
        ticksSinceLastWave++;
        if (waveInProgress) {
            if (map.getTile(TerrainMap.spawn).getEnemy() == null
                    || Point2D.distance(map.getTile(TerrainMap.spawn).getEnemy().getTileX(), map.getTile(TerrainMap.spawn).getEnemy().getTileY(), TerrainMap.spawn.x, TerrainMap.spawn.y) > 1) {
                try {
                    Enemy enemy = new Enemy(map.generatePath(TerrainMap.spawn), currentWaveQueue.pop());
                    enemyList.add(enemy);
                    map.getTile(TerrainMap.spawn).setEnemy(enemy);
                    enemy.update();
                } catch (Exception ex) {
                    System.out.println("cannot place enemy");
                }
            }
            if (currentWaveQueue.isEmpty()) {
                waveInProgress = false;
                ticksSinceLastWave = 0;
            }
        } else if (ticksSinceLastWave > waveDelay) {
            System.out.println("Creating new wave");
            for (int i = 0; i < 10; i++) {
                currentWaveQueue.addLast((int) (100 * Math.pow(1.3, waveNumber)));
            }
            waveNumber++;
            waveInProgress = true;
        }
    }