This commit is contained in:
2026-04-20 01:00:47 -05:00
parent 84cb1f0c78
commit 0606be1d06
4 changed files with 29 additions and 21 deletions

View File

@@ -13,11 +13,12 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
static final Color playerColor = Color.RED;
static final Color tileColor = Color.BLUE;
static final Color SKY = new Color(135, 206, 235);
static final Color NIGHT_SKY = new Color(4, 26, 64);
static final int FRICTION = 1;
static final int MAXYVELO = 15;
static final int MAXXVELO = 5;
static final int totalLevels = 10;
static int[] numAm = {4, 5, 10, 18, 6, 0, 0, 0, 0, 0};
static int[] numAm = {4, 5, 10, 18, 6, 6, 0, 0, 0, 0};
// game objects
Player player;
@@ -347,6 +348,13 @@ public class Platformer extends JPanel implements KeyListener, ActionListener {
return;
}
if (currentLevel == 6) {
this.setBackground(NIGHT_SKY);
}
if (currentLevel == 7) {
this.setBackground(SKY);
}
g.translate(-cameraX, -cameraY);
player.draw(g);