This commit is contained in:
2026-04-20 02:10:56 -05:00
parent 0783b063de
commit b430bf14f0
3 changed files with 28 additions and 19 deletions

View File

@@ -19,7 +19,7 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
static final int MAXYVELO = 15;
static final int MAXXVELO = 5;
static final int totalLevels = 10;
static int[] numAm = {4, 5, 10, 18, 6, 6, 0, 0, 0, 0};
static int[] numAm = {4, 5, 10, 18, 6, 6, 0, 0, 0, 23};
// game objects
Player player;
@@ -111,8 +111,9 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
if (currentLevel > totalLevels) return;
// lvl 3 arena
if (currentLevel == 4) {
if (enemiesKilled < 100 && enemies.isEmpty()) {
if (currentLevel == 4 || currentLevel == 10) {
boolean empty = currentLevel == 4 ? enemies.isEmpty() : enemies.size() <= 5;
if (enemiesKilled < 100 * (currentLevel == 4 ? 1 : 4) && empty) {
Random rand = new Random();
int xOff = rand.nextInt(700);
@@ -122,7 +123,7 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
enemies.add(new Enemy(100 + xOff, 280, 20, 20, currentLevel));
}
} else if (enemiesKilled >= 100) {
} else if (enemiesKilled >= 100 * (currentLevel == 4 ? 1 : 4)) {
collidables.removeIf(c -> c.y == 300 && c.x >= 440 && c.x <= 520);
}
}
@@ -367,8 +368,12 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
if (currentLevel == 2) {
g.drawString("Take a leap of faith....", flag.x - 25, flag.y - 400);
}
if (currentLevel == 4) {
g.drawString("Kill 100 of them...", 220, 200);
if (currentLevel == 4 || currentLevel == 10) {
g.drawString("Kill " + 100 * (currentLevel == 4 ? 1 : 4) + " of them...", 220, 200);
}
if (currentLevel == 10) {
g.drawString("Final Level.... Time for the gauntlet", 80, 80);
}
// flag counter
int amOnes = player.numAmendments % 10;