Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class EscapeRoom{
- public static String password = "Pw08191976";
- public static boolean on = false;
- public static String userName = "";
- public static void main(String[] args) throws InterruptedException{
- Scanner console = new Scanner(System.in);
- intro();
- String input = console.nextLine();
- while(!input.equalsIgnoreCase("Quit")){
- input = console.nextLine();
- }
- }
- public static void intro() throws InterruptedException{
- System.out.println("As you gradually open your eyes, you realize ");
- Thread.sleep(2300);
- System.out.println("you are in Mr.Binz' AP Java classroom.");
- Thread.sleep(2300);
- System.out.print("However, you have no memory of what you were just doing");
- dots();
- Thread.sleep(2150);
- System.out.println("While rubbing the weariness from your eyes, ");
- Thread.sleep(2300);
- System.out.println("you notice that it is pitch black outside.");
- Thread.sleep(2300);
- System.out.println("You get up slowly and casually walk to the exit ");
- Thread.sleep(2300);
- System.out.println("only to grasp that it's locked.");
- Thread.sleep(2300);
- System.out.println("");
- System.out.println("╔══════════════════════╗");
- System.out.println("\tEscape Room");
- System.out.println("\tJuan HeeSoo");
- System.out.println("╚══════════════════════╝");
- System.out.println("");
- userName = getUsername();
- description();
- }
- public static String getUsername() throws InterruptedException{
- Scanner console = new Scanner(System.in);
- Thread.sleep(750);
- System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬");
- Thread.sleep(750);
- System.out.println("Enter a username: ");
- String name = console.next();
- Thread.sleep(750);
- System.out.println("Welcome to the Escape Room");
- System.out.println("\t" + name);
- Thread.sleep(500);
- System.out.println("");
- Thread.sleep(500);
- System.out.println("Enter 'quit' to quit");
- Thread.sleep(750);
- System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬");
- Thread.sleep(750);
- System.out.println("");
- return name;
- }
- public static void description() throws InterruptedException{
- Thread.sleep(950);
- System.out.println("Suddenly, the TV flickers to life!");
- Thread.sleep(1900);
- System.out.print("Behind a wall of static, you notice a figure");
- dots();
- Thread.sleep(2350);
- System.out.println("▬[Mr Binz]▬▬▬▬▬▬▬▬▬▬▬▬ ");
- System.out.println("Hello there, " + userName );
- Thread.sleep(1750);
- System.out.println("It seems like you have awoken. ");
- Thread.sleep(1750);
- System.out.println("You're currently in room 334 taking part in my little expirement.");
- Thread.sleep(1750);
- System.out.println("To get out of my room, ");
- Thread.sleep(1750);
- System.out.println("you will need to solve a series of puzzles.");
- Thread.sleep(1750);
- System.out.println("Good luck, player");
- Thread.sleep(1750);
- System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ");
- Thread.sleep(1700);
- System.out.println("And the TV blacks out!");
- puzzle0();
- }
- public static void puzzle0() throws InterruptedException{
- Thread.sleep(700);
- System.out.println("Hint: Use 'observe' to look around");
- Scanner console = new Scanner(System.in);
- String command = console.next();
- if (command.equalsIgnoreCase("observe")) {
- System.out.println("It seems like the same computer room you come");
- Thread.sleep(2250);
- System.out.println("to everyday. In the vicinity you see the COMPUTERS,");
- Thread.sleep(2250);
- System.out.print("SHELF, DOOR, and a TV");
- dots();
- Thread.sleep(2250);
- System.out.println("Why don't you 'look' around?");
- puzzle1();
- } else if(!command.equalsIgnoreCase("observe")) {
- System.out.println("Unknown command registered!");
- puzzle0();
- }
- }
- public static void puzzle1() throws InterruptedException{
- System.out.println("Hint: 'look' OBJECT");
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- if (command.equalsIgnoreCase("look")) {
- if (object.equalsIgnoreCase("shelf")) {
- System.out.print("There seems to be a few MUGS and BINDERS");
- dots();
- Thread.sleep(2500);
- System.out.println("Suddenly, you feel a breeze coming from behind the shelf!");
- Thread.sleep(800);
- System.out.println("What will you do?");
- puzzle1a();
- } else if (object.equalsIgnoreCase("computers")) {
- System.out.print("You walk over to the computer and power it on");
- dots();
- Thread.sleep(1950);
- System.out.println("It looks like its locked!");
- Thread.sleep(1950);
- System.out.println("It needs a password");
- puzzle1();
- } else if (object.equalsIgnoreCase("door")) {
- System.out.println("You walk over to the door and try the handle.");
- Thread.sleep(1950);
- System.out.println("It seems to be locked!");
- Thread.sleep(1950);
- System.out.print("You peek out the windows, into the hallway");
- dots();
- Thread.sleep(1950);
- System.out.println("It's too dark to notice anything.");
- Thread.sleep(1950);
- System.out.println("As you take a step back, you notice a protruding keyhole,");
- System.out.println("under the handle.");
- puzzle1();
- } else if (object.equalsIgnoreCase("tv")) {
- System.out.println("You walk over to the tv.");
- Thread.sleep(1950);
- System.out.print("It seems like an old box tv");
- dots();
- System.out.println("Several BUTTONs seem to be lining the bottom.");
- Thread.sleep(1950);
- System.out.println("It seems be within a 'push' distance!");
- puzzle1e();
- } else {
- System.out.println("Unknown command registered!");
- puzzle1();
- }
- } else {
- System.out.println("Unknown command registered!");
- puzzle1();
- }
- }
- public static void puzzle1e() throws InterruptedException{
- System.out.println("Try 'push'ing some BUTTONs.");
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- if (command.equalsIgnoreCase("push")) {
- if (object.equalsIgnoreCase("button")) {
- System.out.println("You push the power button on the TV.");
- Thread.sleep(1950);
- System.out.println("Nothing seems to happen.");
- Thread.sleep(1950);
- System.out.println("You try the other buttons.");
- Thread.sleep(1950);
- System.out.print("It seems to be dead");
- dots();
- puzzle1();
- } else {
- System.out.println("Unknown command registered!");
- puzzle1e();
- }
- } else {
- System.out.println("Unknown command registered!");
- puzzle1e();
- }
- }
- public static void puzzle1a() throws InterruptedException{
- System.out.println("Hint: There seems to be something behind the SHELF!");
- Thread.sleep(1200);
- System.out.print(" Maybe you can 'push' it out of the way");
- dots();
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- if (command.equalsIgnoreCase("push")) {
- System.out.println("You push the shelf to find a dark, dusty room");
- Thread.sleep(2250);
- System.out.println("Within it, a lone table stands");
- Thread.sleep(2250);
- System.out.println("You see a thick BOOK sitting on top of it");
- puzzle1b();
- } else if(command.equalsIgnoreCase("observe")) {
- puzzle1();
- } else if(!command.equalsIgnoreCase("push")) {
- System.out.println("Unknown command registered!");
- puzzle1a();
- }
- }
- public static void puzzle1b() throws InterruptedException{
- System.out.println("You lift the heavy cover of the book and wipe off the coat of dust.");
- Thread.sleep(1950);
- System.out.println("On the cover it reads 'AP Java Class of 11111001011'"); //1995
- Thread.sleep(1950);
- System.out.println("As you begin to flip through the pages, you see the names and pictures of several students,");
- Thread.sleep(1950);
- System.out.println("who you don't recognize. Suddenly, a note falls to the ground.");
- Thread.sleep(1950);
- System.out.println("Dear Nathan, Happy 19th Birthday. Congrats on your graduation."); //happy birthday note. August 19 1976 from sidechar1 name later
- Thread.sleep(1950);
- System.out.println("Hopefully you had a good 2 months off of school. I'm sending this on the 14th because");
- Thread.sleep(1950);
- System.out.println("it usually takes around 5 days for my mail to get to you. Hopefully you get this on your");
- Thread.sleep(1950);
- System.out.println("birthday. From /-==-");
- dots();
- Thread.sleep(1650);
- System.out.println("The name is too faded to make out.");
- puzzle1c();
- }
- public static void puzzle1c() throws InterruptedException{
- Thread.sleep(1750);
- System.out.println("Hint: 'Look' somewhere else!");
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- if (command.equalsIgnoreCase("look")) {
- if (object.equalsIgnoreCase("shelf")) {
- System.out.print("There seems to be a few MUGS and BINDERS");
- dots();
- Thread.sleep(2500);
- System.out.println("You have already searched this room, ");
- Thread.sleep(1500);
- System.out.println("would you like to look through it again?");
- puzzle1f();
- } else if (object.equalsIgnoreCase("computers")) {
- System.out.print("You walk over to the computer and power it on");
- dots();
- Thread.sleep(1950);
- System.out.println("On the bottom right corner a notification pops up");
- Thread.sleep(1950);
- System.out.println("The screen prompts for a password");
- Thread.sleep(1950);
- System.out.print("Underneath the password prompt, you can make out some small text");
- dots();
- Thread.sleep(1950);
- System.out.println("Passwords have been reset. Use PwMMDDYYYY as your passwords!");
- puzzle1g();
- } else if (object.equalsIgnoreCase("door")) {
- System.out.println("You walk over to the door and try the handle.");
- Thread.sleep(1950);
- System.out.println("It seems to be locked!");
- Thread.sleep(1950);
- System.out.print("You peek out the windows, into the hallway");
- dots();
- Thread.sleep(1950);
- System.out.println("It's too dark to notice anything.");
- Thread.sleep(1950);
- System.out.println("As you take a step back, you notice a protruding keyhole,");
- System.out.println("under the handle.");
- puzzle1c();
- } else if (object.equalsIgnoreCase("tv")) {
- System.out.println("You walk over to the tv.");
- Thread.sleep(1950);
- System.out.print("It seems like an old box tv");
- dots();
- puzzle1c();
- } else {
- System.out.println("Unknown command registered!");
- puzzle1c();
- }
- } else {
- System.out.println("Unknown command registered!");
- puzzle1c();
- }
- }
- public static void puzzle1f() throws InterruptedException{
- Scanner console = new Scanner(System.in);
- String command = console.next();
- if(command.equalsIgnoreCase("yes")) {
- puzzle1b();
- }else if(command.equalsIgnoreCase("no")) {
- puzzle1c();
- } else {
- System.out.println("Unknown command registered!");
- puzzle1f();
- }
- }
- public static void puzzle1g() throws InterruptedException{
- System.out.println("Enter a Password: ");
- Scanner console = new Scanner(System.in);
- String password = console.next();
- if(password.equals("Pw08191976")) {
- System.out.println("The computer opened");
- Thread.sleep(1650);
- System.out.println("A title named 'Subjects' is open");
- Thread.sleep(1650);
- System.out.println("They are logs describing the past escape room experiment.");
- Thread.sleep(1650);
- System.out.println("One particularly pops out, ");
- Thread.sleep(1650);
- System.out.println("There seems to be a note written on the side");
- Thread.sleep(1650);
- System.out.println("Test Subject 7, displayed erratice behavior before he loses consciousness");
- Thread.sleep(1650);
- System.out.println("He writes on the wall that 'the key is in the room'.");
- Thread.sleep(1650);
- System.out.println("The screen blacks out and the TV flickers back to life again!");
- puzzle2();
- }else if(password.equalsIgnoreCase("Logout")) {
- puzzle1c();
- } else {
- System.out.println("Wrong password");
- Thread.sleep(750);
- System.out.println("Enter 'logout' to return to the room");
- puzzle1g();
- }
- }
- public static void puzzle2() throws InterruptedException{
- System.out.println("▬[Mr Binz]▬▬▬▬▬▬▬▬▬▬▬▬ ");
- Thread.sleep(1750);
- System.out.println("So, " + userName );
- Thread.sleep(1750);
- System.out.println("It seems like you found some old experiment logs.");
- Thread.sleep(1750);
- System.out.println("However, I will congradulate you. None of the other");
- Thread.sleep(1750);
- System.out.println("test subjects have performed as brilliantly as you did.");
- Thread.sleep(1750);
- System.out.println("But like the rest of them, you will never escape this");
- Thread.sleep(1750);
- System.out.println("room.");
- Thread.sleep(1750);
- System.out.println("▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ ");
- Thread.sleep(1750);
- System.out.print("The screen abruptly turns off and leaves the room in darkness");
- dots();
- puzzle2a();
- }
- public static void puzzle2a() throws InterruptedException{
- System.out.println("You stare at the empty screen in silence.");
- System.out.println("Hint: Use 'look' to observe the SHELF, MUGS, COMPUTERS, and DOOR");
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- if (command.equalsIgnoreCase("look")) {
- if (object.equalsIgnoreCase("shelf")) {
- System.out.print("There seems to be a few MUGS and BINDERS");
- dots();
- Thread.sleep(2500);
- System.out.println("You have already searched this room, ");
- Thread.sleep(1500);
- System.out.println("would you like to look through it again?");
- puzzle2a();
- } else if (object.equalsIgnoreCase("computers")) {
- System.out.print("You walk over to the computer and power it on");
- dots();
- Thread.sleep(1950);
- System.out.println("The screen is still black");
- Thread.sleep(1950);
- puzzle2a();
- } else if (object.equalsIgnoreCase("door")) {
- System.out.println("You walk over to the door and try the handle.");
- Thread.sleep(1950);
- System.out.println("It seems to be locked!");
- Thread.sleep(1950);
- System.out.print("You peek out the windows, into the hallway");
- dots();
- Thread.sleep(1950);
- System.out.println("It's too dark to notice anything.");
- Thread.sleep(1950);
- System.out.println("As you take a step back, you notice a protruding keyhole,");
- System.out.println("under the handle.");
- puzzle2a();
- } else if (object.equalsIgnoreCase("tv")) {
- System.out.println("You walk over to the tv.");
- Thread.sleep(1950);
- System.out.print("It seems like an old box tv");
- dots();
- puzzle2a();
- } else if (object.equalsIgnoreCase("binders")) {
- System.out.println("You take a look in the binders.");
- Thread.sleep(1950);
- System.out.print("There seems to be several school documents inside");
- dots();
- Thread.sleep(1950);
- System.out.println("None of them seem to be very important.");
- puzzle2a();
- } else if (object.equalsIgnoreCase("mugs")) {
- System.out.println("You take ahold of a mug and look inside.");
- Thread.sleep(1950);
- System.out.println("Even in the dark room, you can notice a small glint inside.");
- Thread.sleep(1950);
- System.out.print("You reach in and pull out a KEY");
- dots();
- Thread.sleep(1950);
- System.out.println("You take the key and put it in your back pocket.");
- puzzle3();
- } else {
- System.out.println("Unknown command registered!");
- puzzle2a();
- }
- } else {
- System.out.println("Unknown command registered!");
- puzzle2a();
- }
- }
- public static void puzzle3() throws InterruptedException{
- Thread.sleep(1750);
- System.out.println("Hint: 'Look' somewhere else!");
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- if (command.equalsIgnoreCase("look")) {
- if (object.equalsIgnoreCase("shelf")) {
- System.out.print("There seems to be a few MUGS and BINDERS");
- dots();
- Thread.sleep(2500);
- System.out.println("You have already searched this room, ");
- Thread.sleep(1500);
- System.out.println("would you like to look through it again?");
- puzzle3();
- } else if (object.equalsIgnoreCase("computers")) {
- System.out.print("You walk over to the computer and power it on");
- dots();
- Thread.sleep(1950);
- System.out.println("The screen is still black");
- Thread.sleep(1950);
- puzzle3();
- } else if (object.equalsIgnoreCase("door")) {
- System.out.println("You walk over to the door and try the handle.");
- Thread.sleep(1950);
- System.out.println("It seems to be locked!");
- Thread.sleep(1950);
- System.out.print("You peek out the windows, into the hallway");
- dots();
- Thread.sleep(1950);
- System.out.println("It's too dark to notice anything.");
- Thread.sleep(1950);
- System.out.println("As you take a step back, you notice a protruding keyhole,");
- System.out.println("under the handle.");
- Thread.sleep(1950);
- System.out.println("You might be able to 'use' the KEY!");
- puzzle3a();
- } else if (object.equalsIgnoreCase("tv")) {
- System.out.println("You walk over to the tv.");
- Thread.sleep(1950);
- System.out.print("It seems like an old box tv");
- dots();
- puzzle3();
- } else if (object.equalsIgnoreCase("binders")) {
- System.out.println("You take a look in the binders.");
- Thread.sleep(1950);
- System.out.print("There seems to be several school documents inside");
- dots();
- Thread.sleep(1950);
- System.out.println("None of them seem to be very important.");
- puzzle3();
- } else if (object.equalsIgnoreCase("mugs")) {
- System.out.println("You take ahold of a mug and look inside.");
- Thread.sleep(1950);
- System.out.println("There doesn't seem to be anything inside.");
- Thread.sleep(1950);
- System.out.print("You put it back in place.");
- puzzle3();
- } else {
- System.out.println("Unknown command registered!");
- puzzle3();
- }
- } else {
- System.out.println("Unknown command registered!");
- puzzle3();
- }
- }
- public static void puzzle3a() throws InterruptedException{
- Scanner console = new Scanner(System.in);
- String command = console.next();
- String object = console.next();
- if (command.equalsIgnoreCase("use")) {
- if (object.equalsIgnoreCase("key")) {
- System.out.println("You reach into your pocket and pull out a key.");
- Thread.sleep(1950);
- System.out.print("You start inserting the key into the lock");
- dots();
- Thread.sleep(1750);
- System.out.println("To your surprise, it slides into place with a click.");
- Thread.sleep(2450);
- System.out.println("You slowly turn the key and you hear the bolt retract.");
- Thread.sleep(1950);
- System.out.println("As you push the door open and walk out into a long open hallway");
- Thread.sleep(1950);
- System.out.println("you notice that the hallway looks strange,");
- Thread.sleep(1950);
- System.out.print("like it's spinning");
- dots();
- Thread.sleep(1950);
- System.out.println("You fall to your knees and the edges of your vision begin to darken!");
- Thread.sleep(1950);
- System.out.print("You can feel your conciousness begining to fade away");
- dots();
- Thread.sleep(1950);
- System.out.println("And you lose all thought.");
- conclusion();
- intro();
- } else {
- System.out.println("Unknown command registered!");
- puzzle3a();
- }
- } else {
- System.out.println("Unknown command registered!");
- puzzle3a();
- }
- }
- public static void conclusion() throws InterruptedException{
- System.out.println("You have completed the escape room!");
- Thread.sleep(1950);
- System.out.println("Congratulations!");
- Thread.sleep(1950);
- System.out.println("Type 'wake' to wake up!");
- Scanner console = new Scanner(System.in);
- String command = console.next();
- if (command.equalsIgnoreCase("wake")) {
- intro();
- } else {
- System.out.println("Unknown command registered!");
- conclusion();
- }
- }
- public static void dots() throws InterruptedException{
- System.out.print(".");
- Thread.sleep(950);
- System.out.print(".");
- Thread.sleep(950);
- System.out.println(".");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement