Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

teleport method1

By: ace on Sep 6th, 2010  |  syntax: None  |  size: 1.69 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. private void tPort()
  2.         {
  3.             int i = tPort.nextInt(6);
  4.             System.out.println ("you have been teleported.");
  5.             System.out.println ("" + i);
  6.             if(i == 0)
  7.                 {
  8.                     System.out.println("you have been teleported to the outside.");
  9.                     player.setCurrentRoom(rooms.get("outside"));
  10.                 }
  11.             if(i == 1)
  12.                 {
  13.                    System.out.println("you have been teleported to the pub.");
  14.                    player.setCurrentRoom(rooms.get("pub"));
  15.                 }
  16.             if(i == 2)
  17.                 {
  18.                     System.out.println("you have been teleported to the theatre");
  19.                     player.setCurrentRoom(rooms.get("theatre"));
  20.                 }
  21.             if(i == 3)
  22.                 {
  23.                     System.out.println("you have been teleported to the office.");
  24.                     player.setCurrentRoom(rooms.get("office"));
  25.                 }
  26.             if(i == 4)
  27.                 {
  28.                     System.out.println("you have been teleported to the store.");
  29.                     player.setCurrentRoom(rooms.get("store"));
  30.                 }
  31.             if(i == 5)
  32.                 {
  33.                     System.out.println("you have been teleported to the galleria.");
  34.                     player.setCurrentRoom(rooms.get("galleria"));
  35.                 }
  36.              
  37.               else
  38.                 {
  39.                     System.out.println("you have reached the else statement.");
  40.                     printLocationInfo();
  41.                     player.setCurrentRoom(rooms.get("closet"));
  42.              
  43.                 }
  44.             }