Add clouds, fix ghost keypresses after load from save, add example dialogue

master
John 2022-06-17 13:32:53 -04:00
parent 6c60709b93
commit ed150b6629
8 changed files with 22 additions and 9 deletions

BIN
img/backgrounds/cloud4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
img/backgrounds/cloud5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
img/backgrounds/cloud6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
img/backgrounds/cloud7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
img/backgrounds/cloud8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
img/backgrounds/cloud9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -73,7 +73,8 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
public BufferedImageWrapper cloud2 = new BufferedImageWrapper(("img/backgrounds/cloud2.png")); public BufferedImageWrapper cloud2 = new BufferedImageWrapper(("img/backgrounds/cloud2.png"));
public BufferedImageWrapper cloud3 = new BufferedImageWrapper(("img/backgrounds/cloud3.png")); public BufferedImageWrapper cloud3 = new BufferedImageWrapper(("img/backgrounds/cloud3.png"));
public BufferedImageWrapper bomb; public BufferedImageWrapper bomb;
public BufferedImageWrapper onePortrait = new BufferedImageWrapper(("img/dialogue/Gunther.png")); public BufferedImageWrapper narratorPortrait = new BufferedImageWrapper(("img/dialogue/Gunther.png"));
public BufferedImageWrapper villainPortrait = new BufferedImageWrapper(("img/dialogue/Bouncer.png"));
public String lastText; public String lastText;
@ -85,9 +86,21 @@ public class GamePanel extends JPanel implements Runnable, KeyListener, Serializ
cloudTwoBackground = new BackgroundImage(600, 250, cloud2, cloud2.image.getWidth(), cloud3.image.getHeight(), 5, camera); cloudTwoBackground = new BackgroundImage(600, 250, cloud2, cloud2.image.getWidth(), cloud3.image.getHeight(), 5, camera);
cloudThreeBackground = new BackgroundImage(1000, 200, cloud3, cloud2.image.getWidth(), cloud3.image.getHeight(), 5, camera); cloudThreeBackground = new BackgroundImage(1000, 200, cloud3, cloud2.image.getWidth(), cloud3.image.getHeight(), 5, camera);
pauseMenu = new PauseMenu(GAME_HEIGHT/2, 100, 400, 400, GAME_WIDTH, new Font(Font.MONOSPACED, Font.BOLD, 60), "Paused"); pauseMenu = new PauseMenu(GAME_HEIGHT/2, 100, 400, 400, GAME_WIDTH, new Font(Font.MONOSPACED, Font.BOLD, 60), "Paused");
dialogueMenu = new DialogueMenu(GAME_HEIGHT-100, 200, new Font(Font.MONOSPACED, Font.BOLD, 20), onePortrait, true); dialogueMenu = new DialogueMenu(GAME_HEIGHT-100, 200, new Font(Font.MONOSPACED, Font.BOLD, 20), narratorPortrait, true);
dialogueArray.add("Lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum"); dialogueArray.add("Did you ever hear the tragedy of Darth Plagueis The Wise?");
dialogueArray.add("I told you so"); dialogueArray.add("I thought not.");
dialogueArray.add("Its 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 { try {
// load player sprites from disk here // load player sprites from disk here
for (int i = 0; i < 11; i++) { for (int i = 0; i < 11; i++) {

View File

@ -19,11 +19,11 @@ public class GenericSprite extends Rectangle implements Serializable {
public final double speedCapy = 20; public final double speedCapy = 20;
public int WIDTH; //size of ball public int WIDTH; //size of ball
public int HEIGHT; //size of ball public int HEIGHT; //size of ball
public boolean rightPressed = false; transient public boolean rightPressed = false;
public boolean leftPressed = false; transient public boolean leftPressed = false;
public boolean upPressed= false; transient public boolean upPressed= false;
public boolean downPressed = false; transient public boolean downPressed = false;
public boolean isGrounded = false; transient public boolean isGrounded = false;
public boolean isPlayer = false; public boolean isPlayer = false;
//constructor creates ball at given location with given dimensions //constructor creates ball at given location with given dimensions