Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2c622d8
sample push
GithinjiTabz1 Apr 17, 2025
07be9af
committing nananuthouse
merodriguez27 Apr 17, 2025
3ab4ee8
done with two spinners and players
meronoumer Apr 17, 2025
5cac9b4
done2
meronoumer Apr 17, 2025
123c1d6
updated Castle draft code
GithinjiTabz1 Apr 18, 2025
964d788
Merge remote-tracking branch 'origin/meron2' into Tabitha's-branch
GithinjiTabz1 Apr 18, 2025
f84d5a3
Class update
mcarbonellmatos Apr 18, 2025
444ea0e
Merge remote-tracking branch 'origin/Milka' into Tabitha's-branch
GithinjiTabz1 Apr 18, 2025
646e24f
changed the jump logic
GithinjiTabz1 Apr 18, 2025
9e4bc1c
Constructor and accesors
mcarbonellmatos Apr 20, 2025
657d43b
Update
mcarbonellmatos Apr 20, 2025
180ba3d
Map methods updated
mcarbonellmatos Apr 20, 2025
1a80d57
Merge branch 'MayMayBranch' of https://github.com/GithinjiTabz1/CSC12…
meronoumer Apr 21, 2025
72f1afe
Merge branch 'Milka' of https://github.com/GithinjiTabz1/CSC120-Final…
meronoumer Apr 21, 2025
f8f1aed
comittingsomething
merodriguez27 Apr 21, 2025
b202fb8
Committing to branch
merodriguez27 Apr 22, 2025
710af0f
Merge pull request #1 from GithinjiTabz1/MayMayBranch
merodriguez27 Apr 22, 2025
974b58c
committing architechture diagram
meronoumer Apr 23, 2025
3824a64
Merge branch 'main' of https://github.com/GithinjiTabz1/CSC120-FinalP…
meronoumer Apr 23, 2025
4b35b15
committing some path places updates
merodriguez27 Apr 24, 2025
02c7311
Merge branch 'main' of https://github.com/GithinjiTabz1/CSC120-FinalP…
merodriguez27 Apr 24, 2025
a6da189
Map Progress
mcarbonellmatos Apr 24, 2025
dc26925
edited spinner
meronoumer Apr 24, 2025
97d292a
Merge branch 'main' of https://github.com/GithinjiTabz1/CSC120-FinalP…
meronoumer Apr 24, 2025
b651f97
committing more edits
merodriguez27 Apr 24, 2025
1f273f6
Merge branch 'main' of https://github.com/GithinjiTabz1/CSC120-FinalP…
merodriguez27 Apr 24, 2025
c0fb558
Committing Edits
merodriguez27 Apr 25, 2025
16a6d77
nuthouse and parentpathplaces commit
merodriguez27 Apr 26, 2025
36a8fb3
Update
mcarbonellmatos Apr 26, 2025
2fcb15e
fixed player class
meronoumer Apr 26, 2025
49f683f
fixed player class
meronoumer Apr 26, 2025
37eaf72
Merge branch 'main' of https://github.com/GithinjiTabz1/CSC120-FinalP…
meronoumer Apr 26, 2025
5820e24
map update
mcarbonellmatos Apr 26, 2025
5329a4e
Merge branch 'Tabitha's-branch' into Milka
mcarbonellmatos Apr 26, 2025
f11c56e
Merge remote-tracking branch 'origin/MayMayBranch' into Milka
mcarbonellmatos Apr 26, 2025
6dcf289
Merge remote-tracking branch 'origin/main' into Milka
mcarbonellmatos Apr 26, 2025
57ff1ec
minor edits
merodriguez27 Apr 26, 2025
9d2b404
committing minor edits
merodriguez27 Apr 26, 2025
848b1b8
commiting
merodriguez27 Apr 29, 2025
01848f1
map update
mcarbonellmatos Apr 29, 2025
9ad05c6
committing
merodriguez27 Apr 29, 2025
9e6de72
Merge branch 'main' into Milka
mcarbonellmatos Apr 29, 2025
278d68f
Update
mcarbonellmatos Apr 29, 2025
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.debug.settings.onBuildFailureProceed": true
}
56 changes: 56 additions & 0 deletions Castle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
public class Castle {
protected String name;
protected boolean isAccessible;
protected boolean isInTheCastle;

public Castle(String name) {
this.name = name;
this.isAccessible = true;
this.isInTheCastle = false;
}

public String getName() {
return name;
}

public boolean isAccessible() {
return isAccessible;
}

public void setAccessible(boolean accessible) {
this.isAccessible = accessible;
}

public boolean isInTheCastle() {
return isInTheCastle;
}

// Aliases for entering and exiting the castle
public void enter() {
goUp();
}

public void exit() {
goDown();
}

public void goUp() {
if (isAccessible && !isInTheCastle) {
isInTheCastle = true;
System.out.println("You have entered the " + name + ".");
} else if (isInTheCastle) {
System.out.println("You are already in the " + name + ".");
} else {
System.out.println("The " + name + " is not accessible right now.");
}
}

public void goDown() {
if (isInTheCastle) {
isInTheCastle = false;
System.out.println("You have exited the " + name + ".");
} else {
System.out.println("You are not in the " + name + " to exit.");
}
}
}
54 changes: 54 additions & 0 deletions FullSpinner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import java.util.ArrayList;
import java.util.Random;

public class FullSpinner {
private ArrayList<SpinnerPart> parts;

public FullSpinner(){
this.parts = new ArrayList<>();
}


public void addParts(){
parts.add(new SpinnerPart("Red"));
parts.add(new SpinnerPart("Purple"));
parts.add(new SpinnerPart("Yellow"));
parts.add(new SpinnerPart("Blue"));
parts.add(new SpinnerPart("Orange"));
parts.add(new SpinnerPart("Green"));

//adding my candies

parts.add(new SpinnerPart("Ice cream"));
parts.add(new SpinnerPart("Peanut"));
parts.add(new SpinnerPart("Lollipop"));
parts.add(new SpinnerPart("Licorice"));


}
//i'll need to add an override method to a to string

// @Override
// public void toString(){
// return "FullSpinner has a ";
// }

public String spin(){
int Index = random.nextInt(parts.size()); //is it not recognizing random?
String part = parts.get(Index).toString(); //can i not use somethig tat is part of a method in another class
return part ;//the thing that
//how could i do this without a getOutput variable


// just declare a variable that would pick a random number from the number of stuff in the arraylist
//and then just get it to spit out that index


}
public static void main(String[] args) {
FullSpinner spinner = new FullSpinner();
spinner.addParts();
System.out.println(spinner);
}

}
79 changes: 79 additions & 0 deletions LicoriceLagoon.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import java.util.ArrayList;
import java.util.Scanner;


}

public int guessNumber(){
return this.selectNumber;
/*
* When you land in the lagoon you will need to guess a number from 1 to 10.
* If you guess it incorectly, you will get a random trivia question.
* Array List of the trivia questions.
*/
}

public Boolean proceedTrivia(){
/*
* If number guessed is incorrect proceed to trivia questions.
*/
return this.trivia;
}

public String triviaQuestions(){
/*
* Random questions in an Array List
*/
questions = new ArrayList<>();

return this.triviaQuestions;
}

public String proceedOrNot(){
/*
* If trivia questions wrongly answered then player loses
and therefore proceeds through the long way and does not get directly
relocated to were the catsles are.
* If correctly answered then player gets relocated to the first castle.
*/
return this.acceptance;

public class LicoriceLagoon extends PathPlaces{

public LicoriceLagoon(String name, int playerInput, ArrayList triviaQuestions) {
super (name, playerInput, triviaQuestions);
}
public void printPathName() {
/*
* When you land in the lagoon you will need to guess a number.
* If you guess it incorectly, you will get a random trivia question.
* ArrayList of the trivia questions.
*/
System.out.println("You have entered the Licorice Lagoon! You are ready to begin your next challenge. From 2000 - 5000, how many licorice make up the Lagoon?");

Scanner scanner = new Scanner(System.in);
int playerInput = scanner.nextInt();
System.out.println(triviaQuestions.size());
String question = triviaQuestions.get(this.random.nextInt (triviaQuestions.size()));

if (playerInput >= 2000 && playerInput <= 5000) {
if (playerInput % 2 != 0) {
System.out.println("Aha! I see you have done your research! " + playerInput + " licorice make up the Lagoon. You can advance to the next tile.");
} else {
System.out.println("Oh no! " + playerInput + " is not the correct number of licorice that make up the Lagoon. You must complete the following trivia question to move to the next tile." + question);

System.out.println("Well done! You have completed the challenge and may progress to the next tile.");
}
} else {
throw new IllegalArgumentException("Please enter a number between 2000 and 5000.");
}

}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

}
LicoriceLagoon llTest = new LicoriceLagoon("Licorice Lagoon", 2003, PathPlaces.triviaQuestions);
llTest.printPathName();
}
}
29 changes: 29 additions & 0 deletions LollipopCastle.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
public class LollipopCastle extends Castle {
private int jumpAttempts;

public LollipopCastle() {
super("Lollipop Castle");
this.jumpAttempts = 2; // Number of chances the player has to jump correctly
}

public boolean jumpChallenge(int height) {
/*
* Logic:
* - If height is within the safe range (e.g., 5 to 10), the jump is successful.
* - If height is too low (e.g., < 5), the player falls short and "dies".
* - If height is too high (e.g., > 10), the player hits something and "dies".
* - Allow the player up to 'jumpAttempts' to get it right.
*/

// Placeholder return for now — actual logic to be implemented
return false;
}

public int getJumpAttempts() {
return jumpAttempts;
}

public void resetJumpAttempts() {
this.jumpAttempts = 2; //to reset when retrying
}
}
109 changes: 109 additions & 0 deletions Map.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import java.util.ArrayList;

public class Map {
private Boolean position ;
private String colorBlocks;
private String playerPosition;

/* Constructor */
public Map(Boolean position, String colorBlocks, String playerPosition){
this.position = position;
this.colorBlocks = colorBlocks;
this.playerPosition = playerPosition;
}

/*
* Index of each block of the map.
*/
public Boolean indexPosition(){
return this.position;
}

/*
* Tiles of the map.
*/
public String gameBlocks(){
return this.colorBlocks;
}

/*
* Name of the tile (color and index) which the player is in.
*/
public String playerPosition(){
return this.playerPosition;
}

/*
* Establishing the player position, color blocks and index position of the tiles in the map.
*/
public void setPlayerPosition(String playerPosition) {
this.playerPosition = playerPosition;
}

public void setColorBlocks(String colorBlocks) {
this.colorBlocks = colorBlocks;
}

public void setIndexPosition(Boolean position) {
this.position = position;
}

public static void main(String[] args){
/*
* Map array list.
*/
ArrayList<Map> map = new ArrayList<>();
FullSpinner spinner = new FullSpinner();
spinner.addParts();
/*
* Setting the colors of the tiles.
*/
String[] colors = {"Red", "Purple", "Yellow", "Blue", "Orange", "Green"};

/*
* Loop for the map and tiles.
*/
for (int i = 0; i < 61; i++){
String color = colors[i % colors.length];
Map tiles = new Map(false, color, "None");
map.add(tiles);
}

/*
* Position and index gets set in the map.
*/
map.get(playerIndex).setIndexPosition(true);
map.get(playerIndex).setPlayerPosition(Player.getName);

/*
* using the full spinner and spinner parts the color that was randomly selected gets printed.
*/
String spunColor = spinner.spunColor();
System.out.println("Spinner result: " + spunColor);

/*
* Array to make the player move to repsective tile(color) that was spun in the spinner.
*/
int currentPos = Player.getPosition();
int newIndex = -1;
for (int i = playerIndex + 1; i < map.size(); i++){
if (map.get(i).gameBlocks().equalsIgnoreCase(spunColor)){
newIndex = i;
break;
}
else {
System.out.println("There are no tiles of that color ahead.");
}
/*
* Getting final player position after spinner.
*/
if (newIndex != -1){
map.get(playerIndex).setIndexPosition(false);
map.get(playerIndex).setPlayerPosition("None");
map.get(newIndex).setIndexPosition(true);
map.get(newIndex).setPlayerPosition(Player.getName);
playerIndex = newIndex;
System.out.println("Player " + getName + " is now at " + playerIndex);
}
}
}
29 changes: 29 additions & 0 deletions Nana_NutHouse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
*
*/
import java.util.Scanner;

public class Nana_NutHouse extends PathPlaces{

public Nana_NutHouse(String name, int playerInput) {
super (name, playerInput);
}

public int chocoBridgeNumber() {
if (playerInput % 2 != 0) {
System.out.println("Congratulations! Your magic number " + playerInput + " has unlocked the chocolate bridge. You advance to Licorice Lagoon!");
} else {
System.out.println("Oh no! Your number " + playerInput + " has broken the chocolate bridge! You will have to take the long way after you answer this trivia question. Best of luck!");
String question = triviaQuestions.get(this.random.nextInt (triviaQuestions.size()));
System.out.println("Well done! You have completed the challenge and may progress to the next tile.");
}
return this.playerInput;
}

public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);

Nana_NutHouse nanasTest = new Nana_NutHouse("Nana's House", 6);
nanasTest.chocoBridgeNumber();
}
}
Loading