level2 text and display fix

This commit is contained in:
2026-04-19 14:55:09 -05:00
parent a803f5e759
commit 71aacc10c1
4 changed files with 5 additions and 2 deletions

Binary file not shown.

View File

@@ -7,6 +7,7 @@ public class Display {
int tileSize = 20;
JFrame game = new JFrame();
game.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
game.setSize(boardWidth, boardHeight);
game.setVisible(true);
game.setLocationRelativeTo(null);

Binary file not shown.

View File

@@ -166,7 +166,7 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
}
// fall out of world
if (player.y > 2000) {
if (player.y > 1400) {
loadLevel(currentLevel);
player.health--;
}
@@ -330,7 +330,9 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
for (Enemy e : enemies) e.draw(g);
for (Projectile p : projectiles) p.draw(g);
flag.draw(g);
if (currentLevel == 2) {
g.drawString("Take a leap of faith....", flag.x - 25, flag.y - 400);
}
// flag counter
int amOnes = player.numAmendments % 10;
int amTens = player.numAmendments / 10;