
teleport method1
By:
ace on
Sep 6th, 2010 | syntax:
None | size: 1.69 KB | hits: 10 | expires: Never
private void tPort()
{
int i = tPort.nextInt(6);
System.out.println ("you have been teleported.");
System.out.println ("" + i);
if(i == 0)
{
System.out.println("you have been teleported to the outside.");
player.setCurrentRoom(rooms.get("outside"));
}
if(i == 1)
{
System.out.println("you have been teleported to the pub.");
player.setCurrentRoom(rooms.get("pub"));
}
if(i == 2)
{
System.out.println("you have been teleported to the theatre");
player.setCurrentRoom(rooms.get("theatre"));
}
if(i == 3)
{
System.out.println("you have been teleported to the office.");
player.setCurrentRoom(rooms.get("office"));
}
if(i == 4)
{
System.out.println("you have been teleported to the store.");
player.setCurrentRoom(rooms.get("store"));
}
if(i == 5)
{
System.out.println("you have been teleported to the galleria.");
player.setCurrentRoom(rooms.get("galleria"));
}
else
{
System.out.println("you have reached the else statement.");
printLocationInfo();
player.setCurrentRoom(rooms.get("closet"));
}
}