diff --git a/src/main/java/dev/dvorakmortonxd/update.java b/src/main/java/dev/dvorakmortonxd/update.java index efece40..af9a1ec 100644 --- a/src/main/java/dev/dvorakmortonxd/update.java +++ b/src/main/java/dev/dvorakmortonxd/update.java @@ -136,6 +136,12 @@ public class update { m.currentPlayerLocation = "observatoryZX311"; m.playerX = m.playerSizeX; } + } else if (m.currentPlayerLocation.equals("credits")) { // these two lines are basically responsible for the ping poing of the player when he reaches the window border on the credits scene lol + if (m.playerX < 0) { + m.playerXVelocity = 20; + } else if (m.playerX > m.windowWidth-m.playerSizeX) { + m.playerXVelocity = -20; + } } } // triggers render @@ -313,14 +319,19 @@ public class update { g.setColor(new Color(20, 20, 20)); g.fillRect(0, 0, m.windowWidth, 340+128); if (m.playerX > 75) { - g.drawImage(m.doorObservatory, 10, 340, 50, 128, m); + g.drawImage(m.doorObservatory, 0, 340, 50, 128, m); + if (m.playerX > m.windowWidth) { + m.playerX = -25; + m.currentPlayerLocation = "credits"; + m.level = 4; + } } else { g.setColor(Color.black); - g.fillRect(10, 340, 50, 127); + g.fillRect(0, 340, 50, 127); g.setColor(Color.WHITE); g.setFont(m.caveat.deriveFont(Font.BOLD, 30f)); g.drawString("Keep walking to the left thru the door to leave.", 180, m.windowHeight-35); - if (m.playerX < 0) { + if (m.playerX < -m.playerSizeX) { m.playerX = 320; m.currentPlayerLocation = "observatoryZX311"; }