I am making a android game, it's a tower/base defense like type of game (yea I know it is kind of confusing), I was wondering if anyone knows a good way to have the attacking sprites randomly generate without the number of sprites being higher than the level. I want the attack sprites to equal the level. I have 2 sprite types that I want to be generated, I just don't know how to make it to where one of the two randomly comes. Ex: you on level 4 and Sprite A spawns and then 3 others right after it but which version you get is random.
I presume you're running in Android's flavor of Java, so
For generating random numbers, see this.
You'll need to setup a loop, which will load your extra sprites:
I'm assuming you already know how to load, draw, and update sprites. If not, start here.