Hey guys,
At the moment I´m creating a game like the classic "Arkanoid".
After Hours of desperation i hope you guys can help me.
I want to spawn a second ball after the first ball (which is already in the game) hits the barries (reihe4) to the 10th time.
Here is my method:
private int i = 1;
Feld is my World and
ZweiterBallHinzufügen(); is a World Mehtod:
BallfürLevel2() is an Actor (second Ball which should be spawn).
Now to the problem:
This method spawns hundreds of balls but i just want ONE. how can i edit the mehtod to spawn just ONE instead of hundreds..?
THANKS IN ADVANCE!.
public void ZweiterBall()
{
Reihe4 reihe4 = (Reihe4)getOneIntersectingObject(Reihe4.class);
if( reihe4 != null )
{
i++;
}
if( i == 11)
{
Feld feld = (Feld) getWorld();
feld.ZweiterBallHinzufügen();
}
} public void ZweiterBallHinzufügen()
{
addObject(new BallFürLevel2(), 261, 300);
}
