Added a 1up every 200 points
Signed-off-by: Ricky Barrette <rickbarrette@gmail.com>
This commit is contained in:
@@ -171,6 +171,7 @@ public class AsteroidGame extends Thread {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
boolean hasOneUped = false;
|
||||||
while (true){
|
while (true){
|
||||||
if(isStarted) {
|
if(isStarted) {
|
||||||
boolean isThereAsteroids = false;
|
boolean isThereAsteroids = false;
|
||||||
@@ -207,6 +208,17 @@ public class AsteroidGame extends Thread {
|
|||||||
mGameFrame.getStatusBar().incrementLevel();
|
mGameFrame.getStatusBar().incrementLevel();
|
||||||
initLevel();
|
initLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 1up every 200 points
|
||||||
|
*/
|
||||||
|
if(mGameFrame.getStatusBar().getScore() > 0 && mGameFrame.getStatusBar().getScore() % 200 == 0)
|
||||||
|
if(!hasOneUped){
|
||||||
|
mGameFrame.getStatusBar().incrementShipCount();
|
||||||
|
hasOneUped = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
hasOneUped = false;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* sleep till next time
|
* sleep till next time
|
||||||
|
|||||||
Reference in New Issue
Block a user