In my current Asteroid Game, there is a Rocket who shoots bullets to destory Asteroid(s). I want my game to start off with 2 Asteroids and once the Rocket destory them both, 2 +1 more Asteroids spawn. This will represent levels (Level 1 = 2 Asteroids; Level 2 = 3 Asteroids; Level 3 = 4 Asteroids; Continues until Level 10 or something).
Also, it's important to note that this game is made so that if a big Asteroid is shot upon, it breaks up into 2, then shot again, 4 small Asteroid part. I though the best way for me to imply this is by the Score/points (big Asteroid = 1 and small Asteroid = 4). Like said, there being 2 starting Asteroids, the final point you could receive for Level 1 is 46.
Knowing this, this was my attempt
Counter is a Actor class and the score already works.
Summarize, I want to add 1+ Asteroid when current amount of Asteroids are all taken out by the Rocket. Please help and a example of the codes would be helpful. Thank you!
public Counter scoreCounter; private int startAsteroids = 2; public void addAsteroid() { if(scoreCounter.getValue() == 46) { LevelUp lu = new LevelUp(); addObject(lu,300,250); addAsteroids(startAsteroids +1); } }