Révision | ff36078372e1b6e90e5766ee95b8b6649db5c64b (tree) |
---|---|
l'heure | 2022-01-13 23:57:58 |
Auteur | sebastian_bugiu |
Commiter | sebastian_bugiu |
Refactored Status class to only use accessors. Forced portrait orientation for game.
@@ -65,10 +65,10 @@ | ||
65 | 65 | currentPos = indexOf + 1; |
66 | 66 | } |
67 | 67 | |
68 | - if (status.isShowHighScore() && status.score > 0) { | |
68 | + if (status.isShowHighScore() && status.getScore() > 0) { | |
69 | 69 | status.setShowHighScore(false); |
70 | - String highScoreString = status.score + ", " + getDifficultyString(); | |
71 | - scoreMap.put(status.score, highScoreString); | |
70 | + String highScoreString = status.getScore() + ", " + getDifficultyString(); | |
71 | + scoreMap.put(status.getScore(), highScoreString); | |
72 | 72 | if (scoreMap.size() > MAX_HIGH_SCORE_POS) { |
73 | 73 | scoreMap.pollLastEntry(); |
74 | 74 | } |
@@ -140,7 +140,7 @@ | ||
140 | 140 | } |
141 | 141 | Status status = gameEngine.getCanvas().getStatus(); |
142 | 142 | String msg = "Congratulations! You have reached a new " + |
143 | - "High Score: " + status.score + " taking " + status.numPowerupsTaken + | |
143 | + "High Score: " + status.getScore() + " taking " + status.getNumPowerupsTaken() + | |
144 | 144 | " powerups! Difficulty setting: " + getDifficultyString(); |
145 | 145 | } |
146 | 146 |
@@ -197,7 +197,7 @@ | ||
197 | 197 | SpaceRocket game = SpaceRocket.getGame(); |
198 | 198 | if ((game.getCanvas() != null) && |
199 | 199 | (game.getCanvas().getCheckFirePressed().get()) && |
200 | - (game.getCanvas().getStatus().firstTime) && | |
200 | + (game.getCanvas().getStatus().isFirstTime()) && | |
201 | 201 | (game.getGameMode() == SpaceRocket.GameMode.SP) && |
202 | 202 | (!isFireSet())) { |
203 | 203 | game.getCanvas().recordKeyPressed(ExtendedCanvas.FIRE); |
@@ -228,8 +228,8 @@ | ||
228 | 228 | xPos = Float.floatToIntBits(xPosF); |
229 | 229 | yPos = Float.floatToIntBits(yPosF); |
230 | 230 | Status status = canvas.getStatus(); |
231 | - score = status.score; | |
232 | - lives = status.livesRemaining; | |
231 | + score = status.getScore(); | |
232 | + lives = status.getLivesRemaining(); | |
233 | 233 | BossSprite[] boss = gfxMgmt.getBossSprite(); |
234 | 234 | for(int i = 0; i < boss.length; ++i) { |
235 | 235 | if((boss[i].getLaunched()) && (!boss[i].getBossDestroyedSP())) { |
@@ -307,7 +307,7 @@ | ||
307 | 307 | } |
308 | 308 | } |
309 | 309 | String name = new String(b); |
310 | - String str = String.valueOf(canvas.getStatus().score); | |
310 | + String str = String.valueOf(canvas.getStatus().getScore()); | |
311 | 311 | DifficultySelection.Difficulty difficulty = DifficultySelection.getDifficulty(); |
312 | 312 | String temp = name + ", " + str; |
313 | 313 | String HighScoreString = ""; |
@@ -63,9 +63,6 @@ | ||
63 | 63 | private final GlyphLayout timelayout; |
64 | 64 | private final GlyphLayout liveslayout; |
65 | 65 | private GraphicsManager graphicsManager; |
66 | - private int InitialGameTicks = 950; | |
67 | - private int OldGameTicks = InitialGameTicks; | |
68 | -// private int GameTicks = OldGameTicks; | |
69 | 66 | public static final int BLACK = 0xff000000; |
70 | 67 | public static final int WHITE = 0xffffffff; |
71 | 68 | private String timeString; |
@@ -108,8 +105,7 @@ | ||
108 | 105 | } |
109 | 106 | |
110 | 107 | public ExtendedCanvas() { |
111 | - status.livesRemaining = NUM_LIVES; | |
112 | - status.gameTicks = InitialGameTicks; | |
108 | + status.setLivesRemaining(NUM_LIVES); | |
113 | 109 | |
114 | 110 | camera = new OrthographicCamera(); |
115 | 111 | camera.setToOrtho(true, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); |
@@ -173,15 +169,13 @@ | ||
173 | 169 | |
174 | 170 | private void resetTicks() { |
175 | 171 | getStatus().setGameOver(false); |
176 | - getStatus().gameTicks = InitialGameTicks; | |
177 | - OldGameTicks = InitialGameTicks; | |
178 | 172 | } |
179 | 173 | |
180 | 174 | public void reset() { |
181 | 175 | graphicsManager.reset(); |
182 | - getStatus().score = 0; | |
183 | - getStatus().livesRemaining = NUM_LIVES; | |
184 | - getStatus().numPowerupsTaken = 0; | |
176 | + getStatus().setScore(0); | |
177 | + getStatus().setLivesRemaining(NUM_LIVES); | |
178 | + getStatus().setNumPowerupsTaken(0); | |
185 | 179 | resetTicks(); |
186 | 180 | } |
187 | 181 |
@@ -189,10 +183,10 @@ | ||
189 | 183 | graphicsManager.reset(); |
190 | 184 | graphicsManager.getSpaceRocket().setPosition(xPos, yPos); |
191 | 185 | if(score != 0) { |
192 | - getStatus().score = score; | |
186 | + getStatus().setScore(score); | |
193 | 187 | } |
194 | 188 | if(lives != 0) { |
195 | - getStatus().livesRemaining = lives; | |
189 | + getStatus().setLivesRemaining(lives); | |
196 | 190 | } |
197 | 191 | if((currentBoss != -1) && (bossHealth != 0)) { |
198 | 192 | graphicsManager.getBossSprite()[currentBoss].setHealth(bossHealth); |
@@ -231,9 +225,9 @@ | ||
231 | 225 | game.getBatch().setProjectionMatrix(camera.combined); |
232 | 226 | game.getBatch().begin(); |
233 | 227 | graphicsManager.draw(); |
234 | - game.getFont().draw(game.getBatch(), "Score: " + getStatus().score, | |
228 | + game.getFont().draw(game.getBatch(), "Score: " + getStatus().getScore(), | |
235 | 229 | CORNER_X, CORNER_Y + 100); |
236 | - game.getFont().draw(game.getBatch(), "Lives: " + getStatus().livesRemaining, (screenWidth - liveslayout.width), | |
230 | + game.getFont().draw(game.getBatch(), "Lives: " + getStatus().getLivesRemaining(), (screenWidth - liveslayout.width), | |
237 | 231 | CORNER_Y + 100); |
238 | 232 | |
239 | 233 | // if (mp) { |
@@ -266,7 +260,7 @@ | ||
266 | 260 | public void advance(float delta) { |
267 | 261 | checkKeys(); |
268 | 262 | graphicsManager.advance(delta); |
269 | - if (((getStatus().gameTicks == 0) || (getStatus().livesRemaining <= 0)) && (!getStatus().isGameOver())) { | |
263 | + if (((getStatus().getLivesRemaining() <= 0)) && (!getStatus().isGameOver())) { | |
270 | 264 | if (SpaceRocket.getGame().getGameMode() == SpaceRocket.GameMode.SP) { |
271 | 265 | // try { |
272 | 266 | if(!gameOver) { |
@@ -405,10 +399,10 @@ | ||
405 | 399 | |
406 | 400 | public void checkKeys() { |
407 | 401 | if(gameLoaded) { |
408 | - getStatus().firstTime = false; | |
402 | + getStatus().setFirstTime(false); | |
409 | 403 | graphicsManager.appendSpaceRockets(); |
410 | 404 | } |
411 | - if ((getStatus().firstTime) && (SpaceRocket.getGame().getGameMode() == SpaceRocket.GameMode.SP)) { | |
405 | + if ((getStatus().isFirstTime()) && (SpaceRocket.getGame().getGameMode() == SpaceRocket.GameMode.SP)) { | |
412 | 406 | int keyState = getKeyStates(); |
413 | 407 | if (showFireToast) { |
414 | 408 |
@@ -416,7 +410,7 @@ | ||
416 | 410 | } |
417 | 411 | checkFirePressed.set(true); |
418 | 412 | if ((keyState & FIRE_PRESSED) != 0) { |
419 | - getStatus().firstTime = false; | |
413 | + getStatus().setFirstTime(false); | |
420 | 414 | if(!gameLoaded) { |
421 | 415 | this.reset(); |
422 | 416 | } |
@@ -430,11 +424,11 @@ | ||
430 | 424 | return; |
431 | 425 | } |
432 | 426 | |
433 | - if ((getStatus().firstTime) && (SpaceRocket.getGame().getGameMode() == SpaceRocket.GameMode.MP) && | |
427 | + if ((getStatus().isFirstTime()) && (SpaceRocket.getGame().getGameMode() == SpaceRocket.GameMode.MP) && | |
434 | 428 | (graphicsManager.getSpaceRocketsSet())) { |
435 | 429 | this.reset(); |
436 | 430 | graphicsManager.appendSpaceRockets(); |
437 | - getStatus().firstTime = false; | |
431 | + getStatus().setFirstTime(false); | |
438 | 432 | } |
439 | 433 | if (!getStatus().isGameOver()) { |
440 | 434 | int keyState = getKeyStates(); |
@@ -456,7 +450,7 @@ | ||
456 | 450 | graphicsManager.setFire(); |
457 | 451 | } |
458 | 452 | if ((SpaceRocket.getGame().getGameMode() == SpaceRocket.GameMode.MP) && (this.keyCode == KEY_POUND) && (pressed)) { |
459 | - if (getStatus().livesRemaining > 0) { | |
453 | + if (getStatus().getLivesRemaining() > 0) { | |
460 | 454 | graphicsManager.GiveLife(); |
461 | 455 | // gfxMgmt.getOtherSpaceRocket().IncrementLives(); NO need since we use full lives in mp |
462 | 456 | graphicsManager.updateScore(true, false); |
@@ -16,9 +16,9 @@ | ||
16 | 16 | public void setResultsString() { //Before restart!!! |
17 | 17 | Status status = SpaceRocket.getGame().getCanvas().getStatus(); |
18 | 18 | results = Preferences.getInstance().getUsername() + " :\n" + |
19 | - "Score : " + status.score + "\n" + | |
20 | - "Total lives lost : " + status.totalNumLivesLost + "\n" + | |
21 | - "Total powerups taken : " + status.numPowerupsTaken + "\n\n" + | |
19 | + "Score : " + status.getScore() + "\n" + | |
20 | + "Total lives lost : " + status.getTotalNumLivesLost() + "\n" + | |
21 | + "Total powerups taken : " + status.getNumPowerupsTaken() + "\n\n" + | |
22 | 22 | Preferences.getInstance().getCoopUsername() + " :\n" + |
23 | 23 | "Score : " + SpaceRocket.getGame().getCanvas().getGraphicsManager().getOtherSpaceRocket().GetScore();// + "\n" + |
24 | 24 | // "Total lives lost : " + status.CoopTotalNumLivesLost + "\n" + |
@@ -862,9 +862,9 @@ | ||
862 | 862 | } |
863 | 863 | |
864 | 864 | synchronized public void updateScore(boolean isMP, boolean explode) { |
865 | - if (spaceCanvas.getStatus().livesRemaining > 0) { | |
866 | - --spaceCanvas.getStatus().livesRemaining; | |
867 | - ++spaceCanvas.getStatus().totalNumLivesLost; | |
865 | + if (spaceCanvas.getStatus().getLivesRemaining() > 0) { | |
866 | + spaceCanvas.getStatus().decrementLivesRemaining(); | |
867 | + spaceCanvas.getStatus().incrementTotalNumLivesLost(); | |
868 | 868 | |
869 | 869 | if (explode) { |
870 | 870 | Vector2 p = spaceRocket.getSPPos(); |
@@ -873,7 +873,7 @@ | ||
873 | 873 | explosionSprite.launch(p.x, p.y); |
874 | 874 | } |
875 | 875 | } |
876 | - if (spaceCanvas.getStatus().livesRemaining == 0) { | |
876 | + if (spaceCanvas.getStatus().getLivesRemaining() == 0) { | |
877 | 877 | |
878 | 878 | spaceRocket.setVisible(false); |
879 | 879 | } |
@@ -901,7 +901,7 @@ | ||
901 | 901 | Random rand = SpaceRocket.getRandom(); |
902 | 902 | try { |
903 | 903 | Status status = spaceCanvas.getStatus(); |
904 | - if (!spaceCanvas.getStatus().firstTime && spaceCanvas.getStatus().livesRemaining != 0) { | |
904 | + if (!spaceCanvas.getStatus().isFirstTime() && spaceCanvas.getStatus().getLivesRemaining() != 0) { | |
905 | 905 | spaceRocket.advance(xDir, yDir, shoot); |
906 | 906 | if (Utility.intersects(spaceRocket, fireSprite)) { |
907 | 907 | fireSprite.setRegion(touchFireTransRegion); |
@@ -974,17 +974,17 @@ | ||
974 | 974 | advancePlanet = 0; |
975 | 975 | } |
976 | 976 | } |
977 | - if ((isMP) && (spaceRocket != null) && (spaceCanvas.getStatus().livesRemaining == 0)) { | |
977 | + if ((isMP) && (spaceRocket != null) && (spaceCanvas.getStatus().getLivesRemaining() == 0)) { | |
978 | 978 | spaceRocket.setVisible(false); |
979 | 979 | } |
980 | 980 | if ((isMP) && (connectionThread != null) && |
981 | 981 | (connectionThread.getLiveGivenByOtherPlayer())) { |
982 | - if (spaceCanvas.getStatus().livesRemaining == 0) { | |
982 | + if (spaceCanvas.getStatus().getLivesRemaining() == 0) { | |
983 | 983 | spaceRocket.reset(); |
984 | 984 | spaceRocket.setVisible(true); |
985 | 985 | } |
986 | - if (spaceCanvas.getStatus().livesRemaining < 15) { | |
987 | - ++spaceCanvas.getStatus().livesRemaining; | |
986 | + if (spaceCanvas.getStatus().getLivesRemaining() < 15) { | |
987 | + spaceCanvas.getStatus().incrementLivesRemaining(); | |
988 | 988 | } |
989 | 989 | giveLifeSprite[0].setVisible(true); |
990 | 990 | } |
@@ -1041,7 +1041,7 @@ | ||
1041 | 1041 | System.out.println("killedBoss out of range: " + killedBoss); |
1042 | 1042 | } |
1043 | 1043 | } |
1044 | - if ((!isMP) && (spaceCanvas.getStatus().score == BOSS1_SCORE) && (!bossSprite[0].getLaunched()) && | |
1044 | + if ((!isMP) && (spaceCanvas.getStatus().getScore() == BOSS1_SCORE) && (!bossSprite[0].getLaunched()) && | |
1045 | 1045 | (!bossSpriteLaunched[0])) { |
1046 | 1046 | bossSprite[0].launchRandom(); |
1047 | 1047 | bossSpriteLaunched[0] = true; |
@@ -1049,7 +1049,7 @@ | ||
1049 | 1049 | Gdx.input.vibrate(500); |
1050 | 1050 | } |
1051 | 1051 | } |
1052 | - if ((!isMP) && (spaceCanvas.getStatus().score >= BOSS2_SCORE) && (!bossSprite[1].getLaunched()) && | |
1052 | + if ((!isMP) && (spaceCanvas.getStatus().getScore() >= BOSS2_SCORE) && (!bossSprite[1].getLaunched()) && | |
1053 | 1053 | (!bossSpriteLaunched[1]) && (bossSprite[0].getBossDestroyedSP())) { |
1054 | 1054 | bossSprite[1].launchRandom(); |
1055 | 1055 | bossSpriteLaunched[1] = true; |
@@ -1057,7 +1057,7 @@ | ||
1057 | 1057 | Gdx.input.vibrate(500); |
1058 | 1058 | } |
1059 | 1059 | } |
1060 | - if ((!isMP) && (spaceCanvas.getStatus().score >= BOSS3_SCORE) && (!bossSprite[2].getLaunched()) && | |
1060 | + if ((!isMP) && (spaceCanvas.getStatus().getScore() >= BOSS3_SCORE) && (!bossSprite[2].getLaunched()) && | |
1061 | 1061 | (!bossSpriteLaunched[2]) && (bossSprite[0].getBossDestroyedSP()) && |
1062 | 1062 | (bossSprite[1].getBossDestroyedSP())) { |
1063 | 1063 | bossSprite[2].launchRandom(); |
@@ -1066,7 +1066,7 @@ | ||
1066 | 1066 | Gdx.input.vibrate(500); |
1067 | 1067 | } |
1068 | 1068 | } |
1069 | - if ((!isMP) && (spaceCanvas.getStatus().score >= BOSS4_SCORE) && (!bossSprite[3].getLaunched()) && | |
1069 | + if ((!isMP) && (spaceCanvas.getStatus().getScore() >= BOSS4_SCORE) && (!bossSprite[3].getLaunched()) && | |
1070 | 1070 | (!bossSpriteLaunched[3]) && (bossSprite[0].getBossDestroyedSP()) && |
1071 | 1071 | (bossSprite[1].getBossDestroyedSP()) && (bossSprite[2].getBossDestroyedSP())) { |
1072 | 1072 | bossSprite[3].launchRandom(); |
@@ -1101,11 +1101,11 @@ | ||
1101 | 1101 | int type = powerupSprite[i].collisionCheck(spaceRocket); |
1102 | 1102 | if (type != 0) { |
1103 | 1103 | spaceRocket.setPowerupType(type); |
1104 | - ++spaceCanvas.getStatus().numPowerupsTaken; | |
1104 | + spaceCanvas.getStatus().incrementNumPowerupsTaken(); | |
1105 | 1105 | switch (type) { |
1106 | 1106 | case 1: //IncreaseLives |
1107 | - if (spaceCanvas.getStatus().livesRemaining < MAX_NUM_LIVES) { | |
1108 | - ++spaceCanvas.getStatus().livesRemaining; | |
1107 | + if (spaceCanvas.getStatus().getLivesRemaining() < MAX_NUM_LIVES) { | |
1108 | + spaceCanvas.getStatus().incrementLivesRemaining(); | |
1109 | 1109 | } |
1110 | 1110 | break; |
1111 | 1111 | case 2: //More damage to boss |
@@ -1147,7 +1147,7 @@ | ||
1147 | 1147 | if (connectionThread.getPowerupTakenByOtherShip()) { |
1148 | 1148 | if ((currentPowerup <= 3) && (currentPowerup >= 0)) { |
1149 | 1149 | powerupSprite[currentPowerup].reset(); |
1150 | - ++spaceCanvas.getStatus().coopNumPowerupsTaken; | |
1150 | + spaceCanvas.getStatus().incrementCoopNumPowerupsTaken(); | |
1151 | 1151 | } |
1152 | 1152 | |
1153 | 1153 | switch (currentPowerup) { |
@@ -1326,7 +1326,7 @@ | ||
1326 | 1326 | for (int i = 0; i < enemy.length; ++i) { |
1327 | 1327 | if (enemy[i].isVisible()) { |
1328 | 1328 | enemy[i].advance(); |
1329 | - if (!spaceCanvas.getStatus().firstTime) { | |
1329 | + if (!spaceCanvas.getStatus().isFirstTime()) { | |
1330 | 1330 | if (spaceRocket.collisionCheck(enemy[i])) { |
1331 | 1331 | updateScore(isMP, true); |
1332 | 1332 | if (i < (enemy.length - 1)) { |
@@ -1349,8 +1349,7 @@ | ||
1349 | 1349 | for (int j = 0; j < srrocketLeftSprite.length; ++j) { |
1350 | 1350 | if ((srrocketLeftSprite[j].isVisible()) && (enemy[i].isVisible())) { |
1351 | 1351 | if (enemy[i].collisionCheck(srrocketLeftSprite[j])) { |
1352 | - spaceCanvas.getStatus().gameTicks += 100; | |
1353 | - ++spaceCanvas.getStatus().score; | |
1352 | + spaceCanvas.getStatus().incrementScore(); | |
1354 | 1353 | |
1355 | 1354 | if (i < (enemy.length - 1)) { |
1356 | 1355 | ++i; |
@@ -1373,8 +1372,7 @@ | ||
1373 | 1372 | for (int j = 0; j < srrocketRightSprite.length; ++j) { |
1374 | 1373 | if ((srrocketRightSprite[j].isVisible()) && (enemy[i].isVisible())) { |
1375 | 1374 | if (enemy[i].collisionCheck(srrocketRightSprite[j])) { |
1376 | - spaceCanvas.getStatus().gameTicks += 100; | |
1377 | - ++spaceCanvas.getStatus().score; | |
1375 | + spaceCanvas.getStatus().incrementScore(); | |
1378 | 1376 | |
1379 | 1377 | if (i < (enemy.length - 1)) { |
1380 | 1378 | ++i; |
@@ -1471,7 +1469,7 @@ | ||
1471 | 1469 | for (int i = 0; i < enemyrocketSprite.length; ++i) { |
1472 | 1470 | if (enemyrocketSprite[i].isVisible()) { |
1473 | 1471 | enemyrocketSprite[i].advance(); |
1474 | - if (!spaceCanvas.getStatus().firstTime) { | |
1472 | + if (!spaceCanvas.getStatus().isFirstTime()) { | |
1475 | 1473 | if (spaceRocket.collisionCheck(enemyrocketSprite[i])) { |
1476 | 1474 | // synchronized (this) { |
1477 | 1475 | /* --status.LivesRemaining; |
@@ -1597,8 +1595,7 @@ | ||
1597 | 1595 | if (rocket[k].isVisible() && (enemy[i].isVisible())) { |
1598 | 1596 | if (enemy[i].collisionCheck(rocket[k])) { |
1599 | 1597 | if (updateScore) { |
1600 | - spaceCanvas.getStatus().gameTicks += 100; | |
1601 | - ++spaceCanvas.getStatus().score; | |
1598 | + spaceCanvas.getStatus().incrementScore(); | |
1602 | 1599 | } |
1603 | 1600 | |
1604 | 1601 | if (i < (enemy.length - 1)) { |
@@ -1617,8 +1614,8 @@ | ||
1617 | 1614 | // if (!alreadyChecked) { |
1618 | 1615 | if (bossSprite[i].collisionCheck(rocket[j])) { |
1619 | 1616 | // alreadyChecked = true; |
1620 | - if (updateScore) { | |
1621 | - ++spaceCanvas.getStatus().score; | |
1617 | + if (updateScore) { | |
1618 | + spaceCanvas.getStatus().incrementScore(); | |
1622 | 1619 | } |
1623 | 1620 | return true; |
1624 | 1621 | } |
@@ -228,11 +228,11 @@ | ||
228 | 228 | data.putFloat(xPosPerc); |
229 | 229 | data.putFloat(yPosPerc); |
230 | 230 | Status status = spaceCanvas.getStatus(); |
231 | - int score = status.score; | |
231 | + int score = status.getScore(); | |
232 | 232 | /* if(score > 0) { |
233 | 233 | System.out.println("Error: Score increased to " + score); |
234 | 234 | }*/ |
235 | - int lives = status.livesRemaining; | |
235 | + int lives = status.getLivesRemaining(); | |
236 | 236 | /* data[5] = (byte)(score >> 8); |
237 | 237 | data[6] = (byte)(score); |
238 | 238 | data[7] = (byte)(lives);*/ |
@@ -220,7 +220,7 @@ | ||
220 | 220 | |
221 | 221 | synchronized public void DecrementLives() { |
222 | 222 | if (lives > 0) { |
223 | - ++(SpaceRocket.getGame().getCanvas().getStatus().coopTotalNumLivesLost); | |
223 | + SpaceRocket.getGame().getCanvas().getStatus().incrementCoopTotalNumLivesLost(); | |
224 | 224 | --lives; |
225 | 225 | } |
226 | 226 | } |
@@ -3,15 +3,14 @@ | ||
3 | 3 | |
4 | 4 | public class Status { |
5 | 5 | |
6 | - public int score; | |
7 | - public int livesRemaining; | |
6 | + private int score; | |
7 | + private int livesRemaining; | |
8 | 8 | private boolean gameOver; |
9 | - public int gameTicks; | |
10 | - public boolean firstTime = true; | |
11 | - public int numPowerupsTaken; | |
12 | - public int coopNumPowerupsTaken; | |
13 | - public int totalNumLivesLost; | |
14 | - public int coopTotalNumLivesLost; | |
9 | + private boolean firstTime = true; | |
10 | + private int numPowerupsTaken; | |
11 | + private int coopNumPowerupsTaken; | |
12 | + private int totalNumLivesLost; | |
13 | + private int coopTotalNumLivesLost; | |
15 | 14 | private boolean showHighScore; |
16 | 15 | |
17 | 16 | public int getScore() { |
@@ -22,6 +21,10 @@ | ||
22 | 21 | this.score = score; |
23 | 22 | } |
24 | 23 | |
24 | + public void incrementScore() { | |
25 | + ++score; | |
26 | + } | |
27 | + | |
25 | 28 | public int getLivesRemaining() { |
26 | 29 | return livesRemaining; |
27 | 30 | } |
@@ -30,6 +33,14 @@ | ||
30 | 33 | this.livesRemaining = livesRemaining; |
31 | 34 | } |
32 | 35 | |
36 | + public void incrementLivesRemaining() { | |
37 | + ++livesRemaining; | |
38 | + } | |
39 | + | |
40 | + public void decrementLivesRemaining() { | |
41 | + --livesRemaining; | |
42 | + } | |
43 | + | |
33 | 44 | public boolean isGameOver() { |
34 | 45 | return gameOver; |
35 | 46 | } |
@@ -38,14 +49,6 @@ | ||
38 | 49 | this.gameOver = gameOver; |
39 | 50 | } |
40 | 51 | |
41 | - public int getGameTicks() { | |
42 | - return gameTicks; | |
43 | - } | |
44 | - | |
45 | - public void setGameTicks(int gameTicks) { | |
46 | - this.gameTicks = gameTicks; | |
47 | - } | |
48 | - | |
49 | 52 | public boolean isFirstTime() { |
50 | 53 | return firstTime; |
51 | 54 | } |
@@ -62,6 +65,10 @@ | ||
62 | 65 | this.numPowerupsTaken = numPowerupsTaken; |
63 | 66 | } |
64 | 67 | |
68 | + public void incrementNumPowerupsTaken() { | |
69 | + ++numPowerupsTaken; | |
70 | + } | |
71 | + | |
65 | 72 | public int getCoopNumPowerupsTaken() { |
66 | 73 | return coopNumPowerupsTaken; |
67 | 74 | } |
@@ -70,6 +77,10 @@ | ||
70 | 77 | this.coopNumPowerupsTaken = coopNumPowerupsTaken; |
71 | 78 | } |
72 | 79 | |
80 | + public void incrementCoopNumPowerupsTaken() { | |
81 | + ++coopNumPowerupsTaken; | |
82 | + } | |
83 | + | |
73 | 84 | public int getTotalNumLivesLost() { |
74 | 85 | return totalNumLivesLost; |
75 | 86 | } |
@@ -78,6 +89,10 @@ | ||
78 | 89 | this.totalNumLivesLost = totalNumLivesLost; |
79 | 90 | } |
80 | 91 | |
92 | + public void incrementTotalNumLivesLost() { | |
93 | + ++totalNumLivesLost; | |
94 | + } | |
95 | + | |
81 | 96 | public int getCoopTotalNumLivesLost() { |
82 | 97 | return coopTotalNumLivesLost; |
83 | 98 | } |
@@ -86,6 +101,10 @@ | ||
86 | 101 | this.coopTotalNumLivesLost = coopTotalNumLivesLost; |
87 | 102 | } |
88 | 103 | |
104 | + public void incrementCoopTotalNumLivesLost() { | |
105 | + ++coopTotalNumLivesLost; | |
106 | + } | |
107 | + | |
89 | 108 | public boolean isShowHighScore() { |
90 | 109 | return showHighScore; |
91 | 110 | } |
@@ -43,9 +43,9 @@ | ||
43 | 43 | <key>UISupportedInterfaceOrientations</key> |
44 | 44 | <array> |
45 | 45 | <string>UIInterfaceOrientationPortrait</string> |
46 | - <string>UIInterfaceOrientationPortraitUpsideDown</string> | |
46 | + <!-- <string>UIInterfaceOrientationPortraitUpsideDown</string> | |
47 | 47 | <string>UIInterfaceOrientationLandscapeLeft</string> |
48 | - <string>UIInterfaceOrientationLandscapeRight</string> | |
48 | + <string>UIInterfaceOrientationLandscapeRight</string> --> | |
49 | 49 | </array> |
50 | 50 | <key>UILaunchStoryboardName</key> |
51 | 51 | <string>LaunchScreen</string> |