I am trying to add an item to a game that will "float" a player into the correct room. The code below is where the boat is added to a room and the the boolean newBoat is set to true:
Item boat = new Item(" A boat to help you cross the lake \n", "boat", 10);
newBoat = true;
roomThree.addItem(boat);
Below is the method where I am trying to implement the command "float" which if the player has the boat and newBoat is true, currentRoom = roomFour;
/**
*
*/
private void useBoat(Command command)
{
if (newBoat = true) {
currentRoom = roomFour;
System.out.println("You have successfully crossed the lake");
}
newBoat = false;
if (newBoat = false) {
System.out.println("You do not have a boat");
}
}
However, it will not set the currentRoom to roomFour but it will print out the line.