From fcf21cd48dd550a42f6ecfaf6162a1fd7888fa28 Mon Sep 17 00:00:00 2001 From: John Date: Sun, 19 Jun 2022 18:53:37 -0700 Subject: [PATCH] Fix continue bug and remove legacy dialogue --- src/GamePanel.java | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/GamePanel.java b/src/GamePanel.java index b58d0fe..32dddd2 100644 --- a/src/GamePanel.java +++ b/src/GamePanel.java @@ -108,20 +108,6 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ pauseMenuExitTwo = new PauseMenu(GAME_HEIGHT/2, -20, 400, 400, GAME_WIDTH, new Font(Font.MONOSPACED, Font.BOLD, 24), "to the main menu", true); pauseMenuResume = new PauseMenu(GAME_HEIGHT/2, -50, 400, 400, GAME_WIDTH, new Font(Font.MONOSPACED, Font.BOLD, 18), "(or press ESC to resume)", true); dialogueMenu = new DialogueMenu(GAME_HEIGHT-100, 200, new Font(Font.MONOSPACED, Font.BOLD, 20), narratorPortrait, true); - dialogueArray.add("Did you ever hear the tragedy of Darth Plagueis The Wise?"); - dialogueArray.add("I thought not."); - dialogueArray.add("It’s not a story the Jedi would tell you."); - dialogueArray.add("Darth Plagueis was a Dark Lord of the Sith, " + - "so powerful and so wise he could use the Force to influence " + - "the midichlorians to create life… " + - "He had such a knowledge of the dark side that " + - "he could even keep the ones he cared about from dying. " + - "The dark side of the Force is a pathway to many abilities some consider to be unnatural. " + - "He became so powerful… the only thing he was afraid of was losing his power, " + - "which eventually, of course, he did."); - dialogueArray.add("Unfortunately, he taught his apprentice everything he knew, then his apprentice killed him in his sleep."); - dialogueArray.add("Ironic."); - dialogueArray.add("He could save others from death, but not himself."); try { // load player sprites from disk here for (int i = 0; i < 11; i++) { @@ -438,15 +424,15 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ public void run() { if (isNewStart) { LevelManager.setLevel(1); + try { + player.resetNoSound(); + } catch (IOException e) { + throw new RuntimeException(e); + } isDialogue = true; } else { LevelManager.bombs = bombCount; } - try { - player.resetNoSound(); - } catch (IOException e) { - throw new RuntimeException(e); - } //the CPU runs our game code too quickly - we need to slow it down! The following lines of code "force" the computer to get stuck in a loop for short intervals between calling other methods to update the screen. long lastTime = System.nanoTime(); double amountOfTicks = 60;