Hello, i want my enemies (Balloons) to spawn faster over time here is my code:
private int Spawnrate = 100; //je höher desto langsmamer
Balloon balloon = new Balloon();
Leben counter = new Leben();
Geldanzahl geldanzahl = new Geldanzahl();
Kauf_Tower turm = new Kauf_Tower();
Tower tower = new Tower();
/**
* Constructor for objects of class MyWorld.
*
*/
public MyWorld()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(850, 550, 1);
addObject(counter, 325, 50);
addObject(geldanzahl, 525, 50);
addObject(turm, 750, 300);
}
public void act(){
Spawnrate--;
if(Spawnrate <= 0){
addObject(new Balloon(), 14, 239);
Spawnrate = 100;
}
}