Skip to content

Commit

Permalink
New images for EndScreen and GameOverScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
349928465 committed Jun 13, 2024
1 parent b7fb917 commit 57ae560
Show file tree
Hide file tree
Showing 4 changed files with 172 additions and 125 deletions.
15 changes: 14 additions & 1 deletion EndScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ public class EndScreen extends World
private final GreenfootImage gameOverImage = new GreenfootImage("gameOverInstructions.png");

private Crown crown = new Crown();

private GreenfootImage playerImage = new GreenfootImage("GuyR0.png");
private Button player = new Button();

/**
* Constructor for objects of class EndScreen.
*
Expand All @@ -24,6 +28,10 @@ public EndScreen()
{
// Create a new world with 600x400 cells with a cell size of 1x1 pixels.
super(1280, 720, 1);


// Paint Order
setPaintOrder(SuperDisplayLabel.class, Crown.class, Button.class);

// Background
setBackground("brick.jpg");
Expand All @@ -41,7 +49,12 @@ public EndScreen()
gameOverLabel.setLocation(getWidth() / 2, 600);

// Add a Crown
addObject(crown, getWidth()/2, getHeight()/2);
addObject(crown, getWidth()/2-5, getHeight()/2-78);

// Add player
playerImage.scale(140,150);
player.setImage(playerImage);
addObject(player, getWidth()/2, getHeight()/2);

}

Expand Down
9 changes: 8 additions & 1 deletion GameOverScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public class GameOverScreen extends World {
private final SuperDisplayLabel gameOverLabel = new SuperDisplayLabel(font);
private final GreenfootImage gameOverImage = new GreenfootImage("gameOverInstructions.png");

private GreenfootImage playerImage = new GreenfootImage("GuyDeath.png");
private Button player = new Button();

/**
* Constructor for objects of class GameOverScreen.
*/
Expand All @@ -36,7 +39,11 @@ public GameOverScreen() {
gameOverLabel.setImage(gameOverImage);
gameOverLabel.setLocation(getWidth() / 2, 600);


//Add player
playerImage.scale(140,150);
player.setImage(playerImage);
addObject(player, getWidth()/2, getHeight()/2);

}

public void act() {
Expand Down
Binary file added images/GuyDeath.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 57ae560

Please sign in to comment.