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
8 changes: 4 additions & 4 deletions src/main/java/event/Event01.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public void lookFlashlight() {
gm.ui.messageText.setText("This is a flashlight");
}
public void grabFlashlight() {
if(gm.player.hasFlashlight == 0) {
gm.player.hasFlashlight = 1;
if(!gm.player.hasFlashlight) {
gm.player.hasFlashlight = true;
gm.ui.messageText.setText("(You obtained a flashlight)");

gm.player.updatePlayerStatus();
Expand All @@ -55,8 +55,8 @@ public void grabFlashlight() {

}
public void restFlashlight() {
if(gm.player.hasFlashlight == 1) {
gm.player.hasFlashlight = 0;
if(gm.player.hasFlashlight) {
gm.player.hasFlashlight = false;
gm.ui.messageText.setText("*You rest the flashlight back on the bed*");

gm.player.updatePlayerStatus();
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/event/Event02.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ public class Event02 {
GameManager gm;

public Event02(GameManager gm) {

this.gm = gm;
}
public void search1Honda() {
gm.ui.messageText.setText("Nothing sus here");
}

public void search2Honda() {
gm.ui.messageText.setText("OH MY GYAT MY ENGINE IS MISSING");
}

public void restHonda() {
if(gm.player.playerLife != gm.player.playerMaxLife) {
gm.ui.messageText.setText("*You rest on the hood of your car*\n(Your life has been recovered)");
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/event/Event03.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ public Event03(GameManager gm) {
public void lookHondaur() {
gm.ui.messageText.setText("Its a Hondaur");
}

public void talkHondaur() {
gm.ui.messageText.setText("The Hondaur growls at you and revs his engine ");
}

public void attackHondaur() {
gm.ui.messageText.setText("*You start beating the shit out of the poor Hondaur*");

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/event/Event04.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public void lookDenzel() {
gm.ui.messageText.setText("This is Denzel. (He listens to Valorant music)");
}
public void talkDenzel() {
if(gm.player.hasPistol == 0) {
gm.player.hasPistol = 1;
if(!gm.player.hasPistol) {
gm.player.hasPistol = true;
gm.ui.messageText.setText("My oh my I've been waiting for you heh. Here's a glock.\nI saw a monster running with an engine towards the casino!");

gm.player.updatePlayerStatus();
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/event/Event05.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public Event05(GameManager gm) {
this.gm = gm;
}
public void lookHondaTrunk() {
if(gm.player.hasPistol == 1){
if(gm.player.hasPistol){
gm.ui.messageText.setText("IS THAT BRIAN FROM MARAUDER CODED!");
}
else{
Expand All @@ -20,7 +20,7 @@ public void lookHondaTrunk() {
}
public void talkHondaTrunk() {
if(gm.theodoor.currentLife==0 && gm.wheeler.currentLife==0) {
if(gm.player.hasPistol == 1){
if(gm.player.hasPistol){
gm.ui.messageText.setText("Eughh Please... save... Julien and please end my misery");
}
else{
Expand All @@ -35,14 +35,14 @@ public void talkHondaTrunk() {
public void killHondaTrunk() {

if(gm.theodoor.currentLife == 0 && gm.wheeler.currentLife == 0) {
if(gm.player.hasPistol == 1){
if(gm.player.hasPistol){
gm.playSE(gm.pistolShot);
gm.ui.messageText.setText("(You ended Brian's misery)");
}
else{
gm.ui.messageText.setText("(You already ended his misery!)");
}
gm.player.hasPistol = 0;
gm.player.hasPistol = false;
gm.player.updatePlayerStatus();
}
else{
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/event/Event06.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public class Event06 {
private ImageView denzel;

public Event06(GameManager gm) {

this.gm = gm;
}
public void reset(){
Expand All @@ -26,8 +25,8 @@ public void talkDenzel(){
}
public void playDenzel(){

if(gm.player.hasAk47 == 0) {
gm.player.hasAk47 = 1;
if(!gm.player.hasAk47) {
gm.player.hasAk47 = true;
gm.ui.messageText.setText("*You cheer Denzel up by playing Valorant music*\nYou realy know how to cheer me up!\n *Denzel gives you an ak47*");

gm.player.updatePlayerStatus();
Expand All @@ -43,6 +42,7 @@ public void playDenzel(){
public void lookBrandon() {
gm.ui.messageText.setText("This is Brandon. He seems to be doing a fit check");
}

public void talkBrandon() {
gm.ui.messageText.setText("Yo I wouldn't go in there if I were you! A monster is on the loose!");
}
Expand Down
56 changes: 32 additions & 24 deletions src/main/java/event/Event07.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ public Event07(GameManager gm) {
}
public void lookJulian() {
gm.ui.messageText.setText("Julian is in serious condition");
if(julianLife ==0) {
if(julianLife == 0) {
gm.ui.messageText.setText("You see Julien's lifeless body");
}
}
public void talkJulian() {
if(julianLife == 2 || julianLife == 1) {
//Change it to "If Julian has lives"
if(julianLife > 0) {
gm.ui.messageText.setText("*Julian cries when he sees you* I don't want to die...");
}
else {
Expand All @@ -27,50 +28,57 @@ public void talkJulian() {
}
}
public void holdJulian() {
if(julianLife == 2) {
gm.ui.messageText.setText("*You hold Julian's hand and tell him it'll be okay*\nJulian says his last words: Can you spin it one last time for me?");
julianLife=1;
}
if(julianLife == 1) {
gm.ui.messageText.setText("*You hold Julian's hand and tell him it'll be okay*\nJulian says his last words: Can you spin it one last time for me?");
}
else{
gm.ui.messageText.setText("Julian is already dead");
gm.playSE(gm.cannotSound);
//create a switch statement for this method using the number of Julian lives
switch(julianLife) {
case 2:
gm.ui.messageText.setText("*You hold Julian's hand and tell him it'll be okay*\nJulian says his last words: Can you spin it one last time for me?");
julianLife--;
break;
case 1:
gm.ui.messageText.setText("*You hold Julian's hand and tell him it'll be okay*\nJulian says his last words: Can you spin it one last time for me?");
break;
default:
gm.ui.messageText.setText("Julian is already dead");
gm.playSE(gm.cannotSound);
break;
}
}
public void lookSlotMachine() {
gm.ui.messageText.setText("You see the slot machine that the Marauder Coded gang made");
}

public void talkSlotMachine() {
gm.ui.messageText.setText("(The slot machine displays your aura: 10,000,000)");
}

public void spinSlotMachine() {
if(julianLife == 1) {
gm.ui.messageText.setText("*You spin*\n YOU WIN 6 MILLION DOLLARS!!!\n *Julien sighs and passes away*");
julianLife =0;
gm.playSE(gm.slotWin);
}
else{
if(julianLife == 2) {
//use a switch statement with Julian's lives
switch(julianLife) {
case 2:
gm.ui.messageText.setText("You must hold Julian first!");
gm.playSE(gm.cannotSound);
}
if(julianLife < 1) {
break;
case 1:
gm.ui.messageText.setText("*You spin*\n YOU WIN 6 MILLION DOLLARS!!!\n *Julien sighs and passes away*");
julianLife--;
gm.playSE(gm.slotWin);
break;
default:
gm.ui.messageText.setText("*You have no more spins left*");
gm.playSE(gm.cannotSound);
}
break;
}

}

public void lookAdrian() {
gm.ui.messageText.setText("You see Adrian, the leader of the Honda Boyz");
}

public void talkAdrian() {
gm.ui.messageText.setText("It was supposed to be an era of peace between the Honda Boyz and Marauder Coded\n *Adrian cries*\n I tried to save him I really did");
}

public void thankAdrian() {
gm.ui.messageText.setText("*You thank Adrian for his great efforts*\n (Adrian will give you 10% of his profits if you avenge Julian)");

}
}
10 changes: 8 additions & 2 deletions src/main/java/main/ActionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ public void handle(ActionEvent e) {
handleAction(yourChoice);
}

//TODO create an enum to map an interaction with a Honda Boy to a respective action



//TODO break handleAction() into multiple smaller functions that deal with each scene to make code more readable

// handles the action commands
public void handleAction(String yourChoice) {
switch (yourChoice) {
Expand Down Expand Up @@ -182,7 +188,7 @@ public void handleAction(String yourChoice) {
gm.sChanger.showScene1();
break;
case "goScene2":
if(gm.player.hasFlashlight == 1){
if(gm.player.hasFlashlight){
gm.sChanger.showScene2();
}
else {
Expand All @@ -203,7 +209,7 @@ public void handleAction(String yourChoice) {
}
break;
case "goScene5":
if(gm.player.hasPistol == 1){
if(gm.player.hasPistol){
gm.sChanger.showScene5();
}
else {
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/main/GameManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ public class GameManager extends Application {
Music music = new Music();
SoundEffect se = new SoundEffect();

//TODO create an String array with the name of the .wav files

//TODO create an enhanced for loop that applies getClass().getClassLoader.getResource() on each .wav file, parse the name of the .wav file, and assign it to a variable of that name
//SOUND
public URL mainTheme = getClass().getClassLoader().getResource("mainTheme.wav");
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");
Expand Down
19 changes: 10 additions & 9 deletions src/main/java/main/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ public class Player {
public int playerMaxLife;
public int playerLife;

public int hasFlashlight;
public int hasPistol;
public int hasAk47;
//TODO: since the game only uses one of each of these items, use a boolean to check if player has these items
public boolean hasFlashlight;
public boolean hasPistol;
public boolean hasAk47;


public Player(GameManager gm) {
Expand All @@ -24,9 +25,9 @@ public void setPlayerDefaultStatus() {

playerMaxLife = 5;
playerLife = 2;
hasFlashlight = 0;
hasPistol = 0;
hasAk47 = 0;
hasFlashlight = false;
hasPistol = false;
hasAk47 = false;

updatePlayerStatus();
}
Expand All @@ -48,9 +49,9 @@ public void updatePlayerStatus() {
}

// CHECK PLAYER ITEMS
gm.ui.flashlightLabel.setVisible(hasFlashlight == 1);
gm.ui.pistolLabel.setVisible(hasPistol == 1);
gm.ui.ak47Label.setVisible(hasAk47 == 1);
gm.ui.flashlightLabel.setVisible(hasFlashlight);
gm.ui.pistolLabel.setVisible(hasPistol);
gm.ui.ak47Label.setVisible(hasAk47);
}
}

Loading