So i've began coding a small game and need the 'enemys' to spawn from two points.
Heres my code for the enemy spawn;
public void createEnemy(int enemy_count){
for(int i = 0; i < enemy_count; i++){
addEntity(new Enemy((200), -10, tex, this, game));
}
}
As you can see the '(new Enemy((200)' is the point where one enemy would spawn. The other would be at 450.
so how do i alternate between these two point where the enemy spawns each time they are killed?
********************EDIT
// For respawn enemy
if(y > (Game.HEIGHT * Game.SCALE)){
x = 450;
y = -10;
}
Okay im pretty sure ive got to randomize that as well for it to work? ideas? (x needs to be random 450 or 200).
Thanks, Max