Revision | 2de887cf0af6e7f316f784cd3386c6695a9daebe (tree) |
---|---|
Zeit | 2022-01-26 21:55:03 |
Autor | sebastian_bugiu |
Commiter | sebastian_bugiu |
Updated difficulty progress.
@@ -48,7 +48,7 @@ | ||
48 | 48 | public static final float ACCELEROMETER_ERROR = 3.0f; |
49 | 49 | public static final float FLOAT_EPSILON = 0.00001f; |
50 | 50 | private static final float CORNER_X = 0, CORNER_Y = 0; |
51 | - public static final int NUM_LIVES = 1; | |
51 | + public static final int NUM_LIVES = 5; | |
52 | 52 | private static final int HIDDEN_KEY_NUM_PRESSES = 10; |
53 | 53 | public static final int FULL_ACCESS_SCORE = SpaceRocket.DEBUG ? 10 : 150; |
54 | 54 | private static float FONT_HEIGHT; |
@@ -215,6 +215,13 @@ | ||
215 | 215 | if (SpaceRocket.getGame().getGameMode() == SpaceRocket.GameMode.SP) { |
216 | 216 | if (SpaceRocket.getRandom().nextInt(7) == 0) { |
217 | 217 | PowerupSprite powerupSprite = graphicsManager.getPowerupPool().removeOne(); |
218 | +// if (powerupSprite != null && powerupSprite.getType() == 1) { | |
219 | +// // We have an increase lives powerup. | |
220 | +// if (SpaceRocket.getRandom().nextInt(2) == 0) { | |
221 | +// powerupSprite.reset(); | |
222 | +// powerupSprite = null; | |
223 | +// } | |
224 | +// } | |
218 | 225 | if (powerupSprite != null) { |
219 | 226 | float xPos = getX() + (getWidth() * 0.5f) - (powerupSprite.getWidth() * 0.5f); |
220 | 227 | float yPos = getY() + (getHeight() * 0.5f) - (powerupSprite.getHeight() * 0.5f); |
@@ -17,10 +17,10 @@ | ||
17 | 17 | |
18 | 18 | public class GraphicsManager extends LayerManager { |
19 | 19 | |
20 | - private static final int POWERUP_RATE = 70; | |
20 | + private static final int POWERUP_RATE = 400; | |
21 | 21 | private static final int MAX_NUM_LIVES = 15; |
22 | 22 | private static final int BOSS_ROCKET_LAUNCH_RAND = 25; |
23 | - private static final int ENEMY_RAND_1 = 80; | |
23 | + private static final int ENEMY_RAND_1 = 70; | |
24 | 24 | private static final int ENEMY_RAND_2 = 50; |
25 | 25 | private static final int ENEMY_RAND_3 = 20; |
26 | 26 | private static final int ENEMY_RAND_4 = 12; |
@@ -34,14 +34,14 @@ | ||
34 | 34 | private static final int BOSS2_NUM_FRAMES = 3; |
35 | 35 | private static final int BOSS3_NUM_FRAMES = 4; |
36 | 36 | private static final int BOSS4_NUM_FRAMES = 1; |
37 | - private static final int BOSS1_SCORE = 20; | |
38 | - private static final int BOSS2_SCORE = 60; | |
39 | - private static final int BOSS3_SCORE = 120; | |
40 | - private static final int BOSS4_SCORE = 200; | |
41 | - private static final int BOSS1_HEALTH = 20; | |
42 | - private static final int BOSS2_HEALTH = 30; | |
43 | - private static final int BOSS3_HEALTH = 40; | |
44 | - private static final int BOSS4_HEALTH = 60; | |
37 | + private static final int BOSS1_SCORE = 30; | |
38 | + private static final int BOSS2_SCORE = 80; | |
39 | + private static final int BOSS3_SCORE = 200; | |
40 | + private static final int BOSS4_SCORE = 500; | |
41 | + private static final int BOSS1_HEALTH = 40; | |
42 | + private static final int BOSS2_HEALTH = 80; | |
43 | + private static final int BOSS3_HEALTH = 100; | |
44 | + private static final int BOSS4_HEALTH = 140; | |
45 | 45 | private static final int GIVE_LIFE_FRAME_NUM = 3; |
46 | 46 | private static final int ADVANCE_PLANET_FRAMES = 45; |
47 | 47 | private static final int ADVANCE_EARTH_FRAMES = 45; |
@@ -1096,6 +1096,16 @@ | ||
1096 | 1096 | |
1097 | 1097 | if ((!isMP) && (rand.nextInt(POWERUP_RATE) == 0)) { |
1098 | 1098 | PowerupSprite powerupSprite = getPowerupPool().removeOne(); |
1099 | + if (powerupSprite != null && powerupSprite.getType() == 1) { | |
1100 | + // We have an increase lives powerup. | |
1101 | + if (SpaceRocket.getRandom().nextInt(2) == 0) { | |
1102 | + powerupSprite.reset(); | |
1103 | + powerupSprite = null; | |
1104 | + System.out.println("Reset increment lives powerup"); | |
1105 | + } else { | |
1106 | + System.out.println("Launching increment lives powerup"); | |
1107 | + } | |
1108 | + } | |
1099 | 1109 | if (powerupSprite != null) { |
1100 | 1110 | powerupSprite.launchRandom(); |
1101 | 1111 | } |
@@ -1262,10 +1272,10 @@ | ||
1262 | 1272 | int diffHelp = -1; |
1263 | 1273 | switch (difficulty) { |
1264 | 1274 | case EASY: |
1265 | - diffHelp = 200; | |
1275 | + diffHelp = 100; | |
1266 | 1276 | break; |
1267 | 1277 | case MEDIUM: |
1268 | - diffHelp = 100; | |
1278 | + diffHelp = 50; | |
1269 | 1279 | break; |
1270 | 1280 | case HARD: |
1271 | 1281 | diffHelp = 0; |
@@ -49,28 +49,27 @@ | ||
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | - public void launch() { | |
52 | + public void launchRandom() { | |
53 | + super.launchRandom(); | |
53 | 54 | beginTime = System.currentTimeMillis(); |
54 | - Random rand = SpaceRocket.getRandom(); | |
55 | - int XPos = rand.nextInt((int) this.getRightBound()); | |
56 | - int YPos = rand.nextInt((int) this.getBottomBound()); | |
57 | - setPosition(XPos, YPos); | |
58 | - this.setSpeed(0, 0); | |
59 | - setVisible(true); | |
60 | - launchSmoke(0, 0); | |
55 | +// Random rand = SpaceRocket.getRandom(); | |
56 | +// int XPos = rand.nextInt((int) this.getRightBound()); | |
57 | +// int YPos = rand.nextInt((int) this.getBottomBound()); | |
58 | +// setPosition(XPos, YPos); | |
59 | +// this.setSpeed(0, 0); | |
60 | +// setVisible(true); | |
61 | +// launchSmoke(0, 0); | |
61 | 62 | } |
62 | 63 | |
63 | 64 | public void launch(float xPos, float yPos) { |
65 | + super.launch(xPos, yPos); | |
64 | 66 | beginTime = System.currentTimeMillis(); |
65 | - setPosition(xPos, yPos); | |
66 | - this.setSpeed(0, 0); | |
67 | - setVisible(true); | |
68 | 67 | launchSmoke(0, 0); |
69 | 68 | } |
70 | 69 | |
71 | 70 | public void launch(float XPos, float YPos, float xSpeed, float ySpeed) { |
71 | + super.launch(XPos, YPos, xSpeed, ySpeed); | |
72 | 72 | beginTime = System.currentTimeMillis(); |
73 | - super.launch(XPos, YPos, xSpeed, ySpeed); | |
74 | 73 | launchSmoke(xSpeed, ySpeed); |
75 | 74 | } |
76 | 75 |
@@ -81,4 +80,8 @@ | ||
81 | 80 | } |
82 | 81 | |
83 | 82 | } |
83 | + | |
84 | + public int getType() { | |
85 | + return type; | |
86 | + } | |
84 | 87 | } |
@@ -2,5 +2,5 @@ | ||
2 | 2 | app.id=com.headwayent.spacerocket |
3 | 3 | app.mainclass=com.headwayent.spacerocket.IOSLauncher |
4 | 4 | app.executable=IOSLauncher |
5 | -app.build=15 | |
5 | +app.build=17 | |
6 | 6 | app.name=Hotshot 2D |