public void update(float delta) {
        boardTimer += delta / 1000;
        if (boardTimer > minSpawnTime) {
            Random rng = new Random(System.currentTimeMillis());
            int r1 = rng.nextInt();
            int spawnTime = maxSpawnTime - minSpawnTime;
            if ((int) r1 % spawnTime == 0 || boardTimer > (spawnTime)) {
                boardTimer = 0;
                spawn();
            }
        }

        for (int i = 0; i < enemies.size(); i++) {
            if (enemies.get(i).getPosition().x < 0) {
                enemies.remove(enemies.get(i));
            }
        }
    }