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
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
}
55 changes: 55 additions & 0 deletions FullSpinner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import java.util.ArrayList;
import java.util.Random;

public class FullSpinner {
private ArrayList<SpinnerPart> parts;

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


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

//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?
return parts.get(Index).toString();
//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);
}

}
47 changes: 47 additions & 0 deletions Player.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
public class Player {
private String name;
private String color;
private String shape;
private int position;
private String currPosition;


public Player(String name,String color, String shape,int position){
this.name = name ;
this.color = color;
this.shape = shape;
this.currPosition = "red";//if we have all the points on the map that the player can be at set up as an arraylist then im setting this to 0 as statring position
this.position = position;

}

public String getName(){
return name;
}

public int getPosition(){
return position;
}

public void setPosition(int position){
this.position=position;//setter cause this is the only one we need to manipulate
}



public String getCurrPosition() {
return currPosition;
}

public void setCurrPosition(String currPosition) {
this.currPosition = currPosition;
}

public String toString(){
return this.name + " color: " + this.color + " " + this.shape + " player named " + this.name; // Corrected toString

}


}

69 changes: 69 additions & 0 deletions SpinnerPart.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import java.util.random;
import java.util.ArrayList;
import java.util.Random;


public class SpinnerPart {
//text based version of the spinner
// private output;
//this could be a string or an int - and i need to remember the abstraction way to fix that
// private ArrayList<String> Parts;
private String Item;
private String Color;


//initialize the constructor
// public Spinner(ArrayList<String> Parts){
// this.Parts = new ArrayList<>();
// }
//overloading
public SpinnerPart(String Color) {
this.Color = Color;
}
public SpinnerPart(String Color, String Item) {
this.Color = Color;
this.Item = Item;
}

public String getColor(){
return Color;
}

//add sections of candyland spinner onto my parts arraylist maybe in a method

// public ArrayList makeList(String Part){
// Parts.add(Part);

// return Parts;
// }

public String getItem(){
return Item;
}






}

//player takes a turn spinning the spinner :
//if they land on 1 of 2 oranges go to nearest orange
//same logic for purples blues yellow, greens and reds

//if it lands on the pepperminet :
//if it lands on the peanut thingy = // Nana’s NutHouse Class
//if it lands on the lollypop = Lollipop Palace
//if it lands on the icecream

//Map Class
// Peppermint Forest Class
// Licorice Lagoon
// Castle Class - by inheritance
// Lollipop Palace
// Frosted Palace Class
// Queen Kandy’s Castle Class