Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/event/Event06.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void restBrandon() {
gm.ui.messageText.setText("(Your life is full)");
gm.playSE(gm.cannotSound);
if (denzel == null){
denzel = gm.ui.createObjectAndReturn(6, 450, 110, 200, 250, "denzel.png",
denzel = gm.ui.createObjectAndReturn(6, 450, 110, 200, 250, "Character/denzel.png",
"Look", "Talk", "Play", "lookDenzel2", "talkDenzel2", "playDenzel");
denzel.setVisible(true);
}
Expand Down
30 changes: 15 additions & 15 deletions src/main/java/main/GameManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ public class GameManager extends Application {
SoundEffect se = new SoundEffect();

//SOUND
public URL mainTheme = getClass().getClassLoader().getResource("mainTheme.wav");
public URL monsterTheme = getClass().getClassLoader().getResource("monsterTheme.wav");
public URL casinoMusic = getClass().getClassLoader().getResource("casinoMusic.wav");
public URL slotWin = getClass().getClassLoader().getResource("slotWin.wav");
public URL monsterHit = getClass().getClassLoader().getResource("monsterHit.wav");
public URL monsterRoar = getClass().getClassLoader().getResource("monsterRoar.wav");
public URL mainTheme = getClass().getClassLoader().getResource("GeneralStuff/mainTheme.wav");
public URL monsterTheme = getClass().getClassLoader().getResource("Monsters/monsterTheme.wav");
public URL casinoMusic = getClass().getClassLoader().getResource("Background/casinoMusic.wav");
public URL slotWin = getClass().getClassLoader().getResource("Background/slotWin.wav");
public URL monsterHit = getClass().getClassLoader().getResource("Monsters/monsterHit.wav");
public URL monsterRoar = getClass().getClassLoader().getResource("Monsters/monsterRoar.wav");
public URL ak47shots = getClass().getClassLoader().getResource("ak47shots.wav");
public URL pistolShot = getClass().getClassLoader().getResource("pistolShot.wav");
public URL reload = getClass().getClassLoader().getResource("reload.wav");
public URL flashlightSwitch = getClass().getClassLoader().getResource("flashlightSwitch.wav");
public URL heal = getClass().getClassLoader().getResource("heal.wav");
public URL awSound = getClass().getClassLoader().getResource("awSound.wav");
public URL gameOverSound = getClass().getClassLoader().getResource("gameOverSound.wav");
public URL gameOverVoice = getClass().getClassLoader().getResource("gameOverVoice.wav");
public URL cannotSound = getClass().getClassLoader().getResource("cannotSound.wav");
public URL engineNoise = getClass().getClassLoader().getResource("engineNoise.wav");
public URL pistolShot = getClass().getClassLoader().getResource("Weapon/pistolShot.wav");
public URL reload = getClass().getClassLoader().getResource("Weapon/reload.wav");
public URL flashlightSwitch = getClass().getClassLoader().getResource("Flashlight/flashlightSwitch.wav");
public URL heal = getClass().getClassLoader().getResource("Character/heal.wav");
public URL awSound = getClass().getClassLoader().getResource("Weapon/awSound.wav");
public URL gameOverSound = getClass().getClassLoader().getResource("GeneralStuff/gameOverSound.wav");
public URL gameOverVoice = getClass().getClassLoader().getResource("GeneralStuff/gameOverVoice.wav");
public URL cannotSound = getClass().getClassLoader().getResource("GeneralStuff/cannotSound.wav");
public URL engineNoise = getClass().getClassLoader().getResource("GeneralStuff/engineNoise.wav");
public URL currentMusic;

public static void main(String[] args) {
Expand Down
56 changes: 56 additions & 0 deletions src/main/java/main/SceneChanger.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,27 @@

/**
* This class handles the transition of scenes
* * It manages the visibility of background panes, updates game messages,
* * and controls the background music for each scene.
*/
public class SceneChanger {

// Reference to the GameManager instance
GameManager gm;

/**
* Constructor for the SceneChanger class.
* @param gm the GameManager instance that handles game operations.
*/
public SceneChanger(GameManager gm) {

this.gm = gm;
}

/**
* Displays Scene 1: The player's room.
* Updates the background, message text, and music for the scene.
*/
public void showScene1(){

gm.ui.bgPane[1].setVisible(true);
Expand All @@ -26,6 +37,11 @@ public void showScene1(){
gm.currentMusic = gm.mainTheme;
gm.playMusic(gm.currentMusic);
}

/**
* Displays Scene 2: Outside the player's house.
* Updates the background and message text.
*/
public void showScene2(){

gm.ui.bgPane[1].setVisible(false);
Expand All @@ -36,6 +52,11 @@ public void showScene2(){
gm.ui.bgPane[6].setVisible(false);
gm.ui.messageText.setText("You are outside your house");
}

/**
* Displays Scene 3: The woods.
* Updates the background, message text, and plays the monster theme music.
*/
public void showScene3(){
gm.ui.bgPane[1].setVisible(false);
gm.ui.bgPane[2].setVisible(false);
Expand All @@ -49,6 +70,11 @@ public void showScene3(){
gm.currentMusic = gm.monsterTheme;
gm.playMusic(gm.currentMusic);
}

/**
* Displays Scene 4: Encounter with a mysterious character.
* Updates the background, message text, and music for the scene.
*/
public void showScene4() {
gm.ui.bgPane[1].setVisible(false);
gm.ui.bgPane[2].setVisible(false);
Expand All @@ -62,6 +88,11 @@ public void showScene4() {
gm.currentMusic = gm.mainTheme;
gm.playMusic(gm.currentMusic);
}

/**
* Displays Scene 5: Near the casino, with monsters blocking the way.
* Updates the background, message text, and plays the monster theme music.
*/
public void showScene5() {
gm.ui.bgPane[1].setVisible(false);
gm.ui.bgPane[2].setVisible(false);
Expand All @@ -75,6 +106,11 @@ public void showScene5() {
gm.currentMusic = gm.monsterTheme;
gm.playMusic(gm.currentMusic);
}

/**
* Displays Scene 6: Approaching the casino.
* Updates the background, message text, and music for the scene.
*/
public void showScene6() {
gm.ui.bgPane[1].setVisible(false);
gm.ui.bgPane[2].setVisible(false);
Expand All @@ -88,6 +124,11 @@ public void showScene6() {
gm.currentMusic = gm.mainTheme;
gm.playMusic(gm.currentMusic);
}

/**
* Displays Scene 7: Entering the casino.
* Updates the background, message text, and plays casino music.
*/
public void showScene7() {
gm.ui.bgPane[1].setVisible(false);
gm.ui.bgPane[2].setVisible(false);
Expand All @@ -102,6 +143,11 @@ public void showScene7() {
gm.currentMusic = gm.casinoMusic;
gm.playMusic(gm.currentMusic);
}

/**
* Displays Scene 8: Confronting the monster.
* Updates the background, message text, and plays monster theme music.
*/
public void showScene8() {
gm.ui.bgPane[1].setVisible(false);
gm.ui.bgPane[2].setVisible(false);
Expand All @@ -117,6 +163,11 @@ public void showScene8() {
gm.currentMusic = gm.monsterTheme;
gm.playMusic(gm.currentMusic);
}

/**
* Displays the leaderboard screen.
* Updates the background, message text, and shows leaderboard information.
*/
public void viewLeaderboard() {
gm.ui.bgPane[1].setVisible(false);
gm.ui.bgPane[2].setVisible(false);
Expand Down Expand Up @@ -149,6 +200,11 @@ public void showGameOverScreen(int currentBgNum){
gm.playSE(gm.gameOverSound);
gm.playSE(gm.gameOverVoice);
}

/**
* Displays the Game Over screen.
* currentBgNum The current background number to hide before showing the Game Over screen.
*/
public void exitGameOverScreen(){

gm.ui.titleLabel.setVisible(false);
Expand Down
60 changes: 30 additions & 30 deletions src/main/java/main/UI.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void createTitleScreen(Stage primaryStage) {

// Background Image
ImageView backgroundImage = new ImageView(
new Image(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("titleScreen.png")))
new Image(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("Background/titleScreen.png")))
);
backgroundImage.setFitWidth(800);
backgroundImage.setFitHeight(600);
Expand Down Expand Up @@ -252,7 +252,7 @@ public void createPlayerField() {
background.setFill(Color.BLACK); // Set background color to blue

// Load the life icon image
Image lifeImage = new Image(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("heart.png")));
Image lifeImage = new Image(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("GeneralStuff/heart.png")));

// Loop to create and add life icons to the lifePanel
for (int i = 0; i < 5; i++) { // 5 life icons
Expand All @@ -271,21 +271,21 @@ public void createPlayerField() {
inventoryPanel.setStyle("-fx-background-color: black;");

// Initialize and assign flashlightLabel
Image flashlightImage = new Image(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("flashlightIcon.png")));
Image flashlightImage = new Image(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("Flashlight/flashlightIcon.png")));
flashlightLabel = new Label(); // Assign to flashlightLabel
flashlightLabel.setGraphic(new ImageView(flashlightImage));
flashlightLabel.setVisible(false); // Hide initially
inventoryPanel.getChildren().add(flashlightLabel);

// Initialize and assign pistolLabel
Image pistolImage = new Image(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("pistol.png")));
Image pistolImage = new Image(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("Weapon/pistol.png")));
pistolLabel = new Label(); // Assign to pistolLabel
pistolLabel.setGraphic(new ImageView(pistolImage));
pistolLabel.setVisible(false); // Hide initially
inventoryPanel.getChildren().add(pistolLabel);

// Initialize and assign ak47Label
Image ak47Image = new Image(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("ak47.png")));
Image ak47Image = new Image(Objects.requireNonNull(getClass().getClassLoader().getResourceAsStream("Weapon/ak47.png")));
ak47Label = new Label(); // Assign to ak47Label
ak47Label.setGraphic(new ImageView(ak47Image));
ak47Label.setVisible(false); // Hide initially
Expand Down Expand Up @@ -339,61 +339,61 @@ public void displayLeaderboard(List<String> leaderboard) {

public void generateScene() {
// SCENE 1
createBackground(1, "bedroom.png");
createObject(1, 100, 100, 200, 250, "jeramiah.png",
createBackground(1, "Background/bedroom.png");
createObject(1, 100, 100, 200, 250, "Character/jeramiah.png",
"Look", "Talk", "Rest",
"lookJeramiah", "talkJeramiah", "restJeramiah");
createObject(1, 500, 230, 50, 50, "flashlight.png",
createObject(1, 500, 230, 50, 50, "Flashlight/flashlight.png",
"Look", "Grab", "Rest",
"lookFlashlight", "grabFlashlight", "restFlashlight");
createArrowButton(1, 650, 150, 50, 50, "rightArrow50x50.png", "goScene2");
createArrowButton(1, 650, 150, 50, 50, "GeneralStuff/rightArrow50x50.png", "goScene2");
// SCENE 2
createBackground(2, "driveway700x350.png");
createObject(2, 350, 230, 200, 151, "honda200x151.png",
createBackground(2, "Background/driveway700x350.png");
createObject(2, 350, 230, 200, 151, "GeneralStuff/honda200x151.png",
"Search Inside", "Search hood", "Rest",
"search1Honda", "search2Honda", "restHonda");
// SCENE 3
createBackground(3,"woods.png");
createBackground(3, "Background/woods.png");
gm.hondaur.addToScene();
gm.engineStealerMonster.addToScene3();
createArrowButton(3, 650, 150, 50, 50, "rightArrow50x50.png", "goScene4");
createArrowButton(3, 650, 150, 50, 50, "GeneralStuff/rightArrow50x50.png", "goScene4");
// SCENE 4
createBackground(4,"campfire.png");
createObject(4, 100,100, 200,250,"denzel.png"
createBackground(4, "Background/campfire.png");
createObject(4, 100,100, 200,250, "Character/denzel.png"
, "Look", "Talk","Rest","lookDenzel",
"talkDenzel","restDenzel");
createArrowButton(4, 650, 150, 50, 50, "rightArrow50x50.png", "goScene5");
createArrowButton(4, 650, 150, 50, 50, "GeneralStuff/rightArrow50x50.png", "goScene5");
// SCENE 5
createBackground(5,"woods2.png");
createObject(5, 250,150, 200,200,"hondaTrunk.png"
createBackground(5, "Background/woods2.png");
createObject(5, 250,150, 200,200, "Monsters/hondaTrunk.png"
, "Look", "Talk","Kill","lookHondaTrunk",
"talkHondaTrunk","killHondaTrunk");
createArrowButton(5, 650, 150, 50, 50, "rightArrow50x50.png", "goScene6");
createArrowButton(5, 650, 150, 50, 50, "GeneralStuff/rightArrow50x50.png", "goScene6");
gm.theodoor.addToScene();
gm.wheeler.addToScene();
// SCENE 6
createBackground(6, "casinoEntrance.png");
createObject(6, 80, 140, 200, 250, "brandon.png",
createBackground(6, "Background/casinoEntrance.png");
createObject(6, 80, 140, 200, 250, "Character/brandon.png",
"Look", "Talk", "Rest",
"lookBrandon", "talkBrandon", "restBrandon");
createArrowButton(6, 650, 150, 50, 50, "rightArrow50x50.png", "goScene7");
createArrowButton(6, 650, 150, 50, 50, "GeneralStuff/rightArrow50x50.png", "goScene7");
// SCENE 7
createBackground(7, "casino.png");
createObject(7, 200, 130, 200, 224, "julian.png",
createBackground(7, "Background/casino.png");
createObject(7, 200, 130, 200, 224, "Character/julian.png",
"Look", "Talk", "Hold",
"lookJulian", "talkJulian", "holdJulian");
createObject(7, 350, 30, 300, 354, "slotMachine.png",
createObject(7, 350, 30, 300, 354, "Background/slotMachine.png",
"Look", "Talk", "Spin",
"lookSlotMachine", "talkSlotMachine", "spinSlotMachine");
createObject(7, 80, 50, 225, 300, "adrian.png",
createObject(7, 80, 50, 225, 300, "Character/adrian.png",
"Look", "Talk", "Thank",
"lookAdrian", "talkAdrian", "thankAdrian");
createArrowButton(7, 650, 150, 50, 50, "rightArrow50x50.png", "goScene8");
createArrowButton(7, 650, 150, 50, 50, "GeneralStuff/rightArrow50x50.png", "goScene8");
// SCENE 8
createBackground(8, "cityStreet.png");
createBackground(8, "Background/cityStreet.png");
gm.engineStealerMonster.addToScene8();
createArrowButton(8, 650, 150, 50, 50, "rightArrow50x50.png", "goLeaderboard");
createArrowButton(8, 650, 150, 50, 50, "GeneralStuff/rightArrow50x50.png", "goLeaderboard");
// LEADERBOARD SCREEN
createBackground(9,"bedroom.png");
createBackground(9, "Background/bedroom.png");
}
}
6 changes: 3 additions & 3 deletions src/main/java/monsters/EngineStealerMonster.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public EngineStealerMonster(GameManager gm) {
}
public void addToScene3() {

gm.ui.createObject(2, 600,250,50,38,"sponge.png",
gm.ui.createObject(2, 600,250,50,38, "Monsters/sponge.png",
"Look","Talk", "Follow", "lookSponge",
"talkSponge", "followSponge");
}
public void addToScene8() {
gm.ui.createObject(8,200,100,350, 263,"spongeFinalBoss.png",
gm.ui.createObject(8,200,100,350, 263, "Monsters/spongeFinalBoss.png",
"Talk","Attack","Let Live","talkSponge2","attackSponge", "letLiveSponge");
}

Expand Down Expand Up @@ -72,7 +72,7 @@ public void attackSponge(){

if(currentLife == 0){
if (blood == null) {
blood = gm.ui.createObjectAndReturn(8, 200, 100, 200, 233, "blood.png", "", "", "", "", "", "");
blood = gm.ui.createObjectAndReturn(8, 200, 100, 200, 233, "Monsters/blood.png", "", "", "", "", "", "");
}

// Make them visible
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/monsters/Hondaur.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public Hondaur(GameManager gm) {
}
public void addToScene() {

gm.ui.createObject(3, 300,100,200,283,"Hondaur_2.png",
gm.ui.createObject(3, 300,100,200,283, "Monsters/Hondaur_2.png",
"Look","Talk", "Attack", "lookHondaur",
"talkHondaur", "attackHondaur");
}
Expand Down Expand Up @@ -59,10 +59,10 @@ public void attackHondaur() {

if(currentLife == 0){
if (blood == null) {
blood = gm.ui.createObjectAndReturn(3, 340, 100, 200, 233, "blood.png", "", "", "", "", "", "");
blood = gm.ui.createObjectAndReturn(3, 340, 100, 200, 233, "Monsters/blood.png", "", "", "", "", "", "");
}
if (anthony == null) {
anthony = gm.ui.createObjectAndReturn(3, 100, 100, 200, 250, "anthony.png",
anthony = gm.ui.createObjectAndReturn(3, 100, 100, 200, 250, "Character/anthony.png",
"Look", "Talk", "Touch", "lookAnthony", "talkAnthony", "touchAnthony");
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/monsters/Theodoor.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public Theodoor(GameManager gm) {
}
public void addToScene() {

gm.ui.createObject(5, 450,95,200,283,"theodoor.png",
gm.ui.createObject(5, 450,95,200,283, "Monsters/theodoor.png",
"Look","Talk", "Attack", "lookTheodoor",
"talkTheodoor", "attackTheodoor");
}
Expand Down Expand Up @@ -61,7 +61,7 @@ public void attackTheodoor() {

if(currentLife == 0){
if (blood == null) {
blood = gm.ui.createObjectAndReturn(5, 450, 95, 200, 233, "blood.png", "", "", "", "", "", "");
blood = gm.ui.createObjectAndReturn(5, 450, 95, 200, 233, "Monsters/blood.png", "", "", "", "", "", "");
}

// Make them visible
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/monsters/Wheeler.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public Wheeler(GameManager gm) {
}
public void addToScene() {

gm.ui.createObject(5, 50,95,200,283,"wheel.png",
gm.ui.createObject(5, 50,95,200,283, "Monsters/wheel.png",
"Look","Talk", "Attack", "lookWheeler",
"talkWheeler", "attackWheeler");
}
Expand Down Expand Up @@ -61,7 +61,7 @@ public void attackWheeler() {

if(currentLife == 0){
if (blood == null) {
blood = gm.ui.createObjectAndReturn(5, 50, 95, 200, 233, "blood.png", "", "", "", "", "", "");
blood = gm.ui.createObjectAndReturn(5, 50, 95, 200, 233, "Monsters/blood.png", "", "", "", "", "", "");
}

// Make them visible
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.