Look over my code and give tips?

This is my text based adventure game. I know there's something wrong with my items class. What should I do to fix it?

Java Code:

import java.util.Scanner;
public class Game {
public static void main(String[] args) {//Start of main program
Scanner typed = new Scanner(System.in);//Create new scanner that reads what the player typed
Player player = new Player(); // make player
Room entryWay = buildWorld();
player.moveTo(entryWay); // player starts at entryway
printInstructions(); // prints instructions for players to read
play(player); // allows game to be played
}
public static Room buildWorld(){
Room pink = new Room("Pink Room"); // create room
Room blue = new Room("Blue Room");
Room purple = new Room("Purple Room");
Room white = new Room("White Room");
Room red = new Room("Red Room"); // create room
pink.setNorth(blue); //set directions for pink room
pink.setSouth(blue);
pink.setWest(white);
pink.setEast(purple);
blue.setNorth(pink); //set directions for blue room
blue.setSouth(pink);
blue.setWest(red);
blue.setEast(white);
purple.setNorth(red); // set directions for purple room
purple.setSouth(purple);
purple.setWest(white);
purple.setEast(pink);
white.setNorth(white); // set directions for white room
white.setSouth(red);
white.setWest(white);
white.setEast(blue);
red.setNorth(red); // set directions for red room
red.setSouth(pink);
red.setWest(white);
red.setEast(pink);
return pink;
}
Item Gold = new Item("Gold",50);
Item Silver = new Item ("Silver",50);
Item Bronze = new Item ("Bronze",50);
static void play(Player player){
Scanner in = new Scanner(System.in); // creates scanner
String output = new String(); // creates string
while(in.hasNext()){ // as long as there is input from the person playing the game
output = in.next();
if (output.equals("North")){ //recognizes when player writes north
player.moveTo(player.location.getNorth()); // moves player to the room north leads into
System.out.println("You are now in the " + player.location.Name); // prints the players new location
}
if (output.equals("South")){ //recognizes when player writes south
player.moveTo(player.location.getSouth()); // moves player to the room south leads into
System.out.println("You are now in the " + player.location.Name); // prints the players new location
}
if (output.equals("West")){ //recognizes when player writes west
player.moveTo(player.location.getWest()); // moves player to the room west leads into
System.out.println("You are now in the " + player.location.Name); // prints the players new location
}
if (output.equals("East")){ //recognizes when player writes east
player.moveTo(player.location.getEast()); // moves player to the room east leads into
System.out.println("You are now in the " + player.location.Name); // prints the players new location
}
}
}
static void printInstructions(){
System.out.println(" Welcome to Adventureland! In this game, there are 5 rooms: Pink, Blue, Red, White, and Purple. The rooms are interconnected and each have four directions. You can move to the north, south, west, or east in each room by typing out the direction you want to move in, with a capital first letter. Keep in mind that just because a certain direction leads you to a room, doesn't mean that it will take you back to the room you were previously in. Also, there are doors that lead you back into the same room you were just in. Have fun and try to collect as much gold as possible!!");
}
}//End of the Adventure class
public class Item {
String Name;
Item Gold;
Item Silver;
Item Bronze;
public Item(String name, int amount){
Name = name;
}
void setGold(Item r){
Gold = r;
}
Item getGold(){
return Gold;
}
void setSilver(Item r){
Silver = r;
}
Item getSilver(){
return Silver;
}
void setBronze(Item r){
Bronze = r;
}
Item getBronze(){
return Bronze;
}
}
public class Player {
public Room location; //current location of the player
void moveTo(Room c){ //changes the current location of the player to room c.
location = c; // the current location is updated
}
}
public class Room { //Start of Room class
String Name; //room name
Room North; //connects to other rooms
Room South; // connects to other rooms
Room West; // connects to other rooms
Room East; // connects to other rooms
public Room (String name){
Name = name;
}
void setNorth(Room r){
North = r;
}
Room getNorth(){
return North;
}
void setSouth(Room r){
South = r;
}
Room getSouth(){
return South;
}
void setEast(Room r){
East = r;
}
Room getEast(){
return East;
}
void setWest(Room r){
West = r;
}
Room getWest(){
return West;
}
Item Gold;
Item Silver;
Item Bronze;
}//End of Room class

Re: Look over my code and give tips?

That's a lot of unformatted code to ask us to go through and a very vague question. Consider adding [code[i]] [/code[i]] tags around your code so we can read it, and also try to isolate your problem a bit so you can ask an answerable question.

Re: Look over my code and give tips?

So I attempted to add the code tags, but I wasn't able to it successfully. Here is the problem: I have a text-based game. The player can change rooms and move around the virtual world, but now I want to put items in the game that the player can pick up and drop (this is done in the item class). That's the part I can't do. So, if anyone has ever made a game like this, or knows about them, how should I go about doing this?

Re: Look over my code and give tips?

Originally Posted by LuluMM

I'm trying to have the items be accessible by the player. I had a feeling the fields I was using were wrong, what should I use instead?

Consider creating an Item class that doesn't hold Item variables but instead is nothing more than a blueprint for what an Item represents, it's name, its value, perhaps its weight, etc... And then create Item objects using this class.