# How would I spawn a function of different enemies at scores 10, 25 , 40

How would I spawn a function of a same enemy at scores 0-10, 11-25 ,26-40 as well as spawn enemies from as bonus at score 23, and 27. So from 0-10, 11-25 ,26-40 the same enemy for each range is spawned a total of 11 times, 15 times, and 15 times. But at score 23 and 27 that enemy is only spawned once and at scores 23 and 27 2 different enemies are spawning?
Thanks

Well presumably you keep a global in your game for the score the player has at a given time. In the update method you can run a check for enemySpawninStrategy for example. Here you basically check what the score is.

If its between 0 & 10 you call spawnEnemy1 and assign a value of 11 to a variable called spawnCount.

Else if score is between 11 and 25 then you call spawnEnemy1 and assign a value of 15 to spawnCount and then inside that if, you check if score = 23 || 27, if not, you return; if true then call spawnEnemy2.

Else if score is between 26 and 40 again call spawnEnemy1 and assign a value of 15 to spawnCount and then inside that if, you check if score = 23 || 27, if not, you return; if true then call spawnEnemy2.

I think thats what you want, or did I misunderstand?