Skip to content

Commit d9a06fc

Browse files
committed
fix: Fix restart function
restart 시 restart 전 단계의 formation으로 시작하는 문제 해결 INVADERS-74
1 parent 3b29a87 commit d9a06fc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/screen/GameScreen.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public class GameScreen extends Screen {
3737
private static final int SCREEN_CHANGE_INTERVAL = 1500;
3838
/** Height of the interface separation line. */
3939
private static final int SEPARATION_LINE_HEIGHT = 40;
40+
/** Difficulty settings for level 1. */
41+
private static final GameSettings RESTART_SETTING =
42+
new GameSettings(5, 4, 60, 2000);
4043

4144
/** Current game difficulty settings. */
4245
private GameSettings gameSettings;
@@ -72,7 +75,7 @@ public class GameScreen extends Screen {
7275
private boolean bonusLife;
7376
/** Pause Screen */
7477
private Screen pausescreen;
75-
78+
/** Title Screen */
7679
private Screen titlescreen;
7780
/** Check if game is pause */
7881
private boolean isPause;
@@ -310,6 +313,9 @@ else if (this.returnCode == 7) {
310313
this.level = 1;
311314
this.score = 0;
312315
this.lives = 3;
316+
this.bulletsShot = 0;
317+
this.shipsDestroyed = 0;
318+
this.gameSettings = RESTART_SETTING;
313319
initialize();
314320
this.logger.info("Restart");
315321
this.isPause = false;

0 commit comments

Comments
 (0)