Hey!
Here's an example. Click the buttons to change level. At each level it will spawn a number of enemies determined by the array "arLevels".
Level 1: 2 squares, 5 circles, 0 triangles
Level 2: 3 squares, 3 circles, 1 triangles
Level 3: 5 squares, 2 circles, 3 triangles
Let me know if you have any trouble understanding the code.
Hope this helps...
Cheers!