Merge remote-tracking branch 'origin/master'

master
bob 2022-06-20 11:30:06 -04:00
commit 52800c5a9b
3 changed files with 16 additions and 13 deletions

View File

@ -1,2 +1 @@
Have you heard of the tragedy of $Empty
Darth Charlie the Wise?

View File

@ -49,20 +49,20 @@ public class LevelManager implements Serializable {
try { try {
MapReader.inputMap(filePath); MapReader.inputMap(filePath);
if (!hasDied) { if (!hasDied) {
GameFrame.game.dialogueArray = new ArrayList<String>(Arrays.asList(MapReader.inputDialogue(filePath))); if (!(MapReader.inputDialogue(filePath)[0].equals("$Empty"))) {
if (GameFrame.game.dialogueArray.get(0).contains("$Villain")) { GameFrame.game.dialogueArray = new ArrayList<String>(Arrays.asList(MapReader.inputDialogue(filePath)));
GameFrame.game.dialogueArray.remove(0); if (GameFrame.game.dialogueArray.get(0).contains("$Villain")) {
GameFrame.game.dialogueMenu.isNarrator = false; GameFrame.game.dialogueArray.remove(0);
// TODO: move img path to GamePanel GameFrame.game.dialogueMenu.isNarrator = false;
GameFrame.game.dialogueMenu.PORTRAIT = new BufferedImageWrapper("img\\dialogue\\Bouncer.png"); // TODO: move img path to GamePanel
GameFrame.game.dialogueMenu.PORTRAIT = new BufferedImageWrapper("img\\dialogue\\Bouncer.png");
}
GameFrame.game.dialogueMenu.currentFrame = 0;
GameFrame.game.dialogueMenu.frameCounter = 0;
GameFrame.game.isDialogue = true;
} }
GameFrame.game.dialogueMenu.currentFrame = 0;
GameFrame.game.dialogueMenu.frameCounter = 0;
GameFrame.game.isDialogue = true;
} }
// reset signs // reset signs
GameFrame.game.tutorialSign = new ArrayList<WallSign>();
GameFrame.game.loreSign = new ArrayList<WallSign>();
GameFrame.game.tutorialSign.clear(); GameFrame.game.tutorialSign.clear();
GameFrame.game.loreSign.clear(); GameFrame.game.loreSign.clear();
// temporary boolean, so only declared here // temporary boolean, so only declared here

View File

@ -161,6 +161,8 @@ public class MenuPanel extends JPanel implements Runnable, KeyListener{
if(textBoxArray.get(currentBox).id.contains("game")){ if(textBoxArray.get(currentBox).id.contains("game")){
gameStart = true; gameStart = true;
} }
// always unpause game, no matter what screen is navigated to
GameFrame.game.isPaused = false;
// logic for different screens starts here // logic for different screens starts here
if (textBoxArray.get(currentBox).id.equals("game-start")) { if (textBoxArray.get(currentBox).id.equals("game-start")) {
try { try {
@ -170,6 +172,8 @@ public class MenuPanel extends JPanel implements Runnable, KeyListener{
GameFrame.game.player.yVelocity = 0; GameFrame.game.player.yVelocity = 0;
GameFrame.game.map = new Tile[1000][18]; GameFrame.game.map = new Tile[1000][18];
GameFrame.game = new GamePanel(GameFrame.main); //run GamePanel constructor GameFrame.game = new GamePanel(GameFrame.main); //run GamePanel constructor
GameFrame.game.isContinue = true;
textBoxArray.add(continueGame);
GameFrame.game.startThread(); GameFrame.game.startThread();
GameFrame.main.add(GameFrame.game, "game", 0); GameFrame.main.add(GameFrame.game, "game", 0);
} catch (IOException | SpriteException | UnsupportedAudioFileException | LineUnavailableException ex) { } catch (IOException | SpriteException | UnsupportedAudioFileException | LineUnavailableException ex) {