©Yeonjoon Jang, All Rights Reserved

”’

FINAL PROJECT

Joon Jang

————–

STORY SUMMARY

1) Main Character            : Detective James

2) Game Space                : Mr. Goodman’s House

3) Rooms (how many? names?)  : Five rooms and a staircase

4) Objects (how many? names?): One baseball bat and two notes

5) Objective                 : Use the notes to access the stairs, head to the basement, and reveal the truth.

                               Oh, and make sure to bring the bat with you when going to the basement. You are not alone in this game.

GAME MAP (includes a compass, room names, doors, object names, * indicates puzzle)

        Ground Floor

        ____________________________________________________________

        |                                               |   down    |

        |                                               |           |

        |                                               |           |

        |                   Ethan’s Room (D)            |           |

        |                                               |           |

        |  note                                         |           |

        |________________________S______________________|           |

        |                        N                      |STAIRS (E) |

        |                                               |           |

        |                                               |           |

        |                                               |           |

        |                                               |     *     |

        |               Living Room (C)                 |           |

        |                                               |           |

        |                                              E|W          |

        |                                               |           |

        |  note                                         |           |

        |_________________________________________S_____|___________|                                               

        |                                     |   N                 |

        |                                     |                     |

        |                                     |                     |

        |                                     |                     |

        |        Mr. Goodman’s Room (B)      E|W    Entrance (A)    |

        |                                     |                     |

        |                                     |                     |

        |  baseball bat                       |                     |

        |_____________________________________|_____________________|

        Basement Floor

        _____________________________________________________________

        |                                               |           |

        |                                               |           |

        |                                               |           |

        |                                               |           |

        |                                               |           |

        |                                               |           |

        |                                               |           |

        |                                               |           |

        |                   BASEMENT (F)                | STAIRS (E)|

        |                                               |           |

        |                                               |           |

        |                                               |           |

        |                                               |           |

        |                                               |           |

        |                                              E|W          |

        |                                               |           |

        |  ?                                            |     up    |

        |_______________________________________________|___________|                                               

                                N

                            W       E

                                S

”’

# ##########

# function name: game_instructions

# receives: nothing

# description:

#    displays the game instructions

# returns: nothing

# ##########

def game_instructions ():

# Game Scenario/Instructions

    print (“You, Detective James, have been asked by Mr. Goodman to find his son Ethan,”)

    print (“a young teenager that has recently gone missing. To solve the mystery, you have”)

    print (“just arrived in the Goodmans’ Home, with full access to every room—except the”)

    print (“basement. Mr. Goodman specifically warned you to not go in the basement, and”)

    print (“there also seems to be a lock on the stairway leading to it.”)

    print()

    print (“In any room, Detective selects their next action from a menu of “)

    print (“action choices.  In general, the choices include “)

    print (“* selecting a door (NOTE: only available doors will be listed)”)

    print (“* picking up an object (NOTE: only if an object is available AND”)

    print (”  Detective James has no object.)”)

    print (“* Dropping an object (NOTE: only if Detective James has an object)”)

    print (“* solving a puzzle.  If the puzzle is incorrectly solved after”)

    print (”  three tries, Detective James is terminated”)

    print ()

    print (“The game ends when Detective James either wins the game or dies”)

    print ()

    print (40 * “*”)

    print ()

    print (“Game Begins Now …”)

    print ()

    print (40 * “*”)

    print ()

game_instructions()

held_item = None

bat_location = “roomb”

def rooma():

    global held_item

    global bat_location

    print(“You are in the Entrance.”)

    if held_item is None:

        print(“You are holding no objects.”)

    else:

        print(“You are holding the ” + held_item + “.”)

    if bat_location == “rooma”:

        print(“The room has a Baseball Bat, which can be picked up. (P)”)

    else:

        print(“The room has no objects.”)

    print(“Doors: N W”)

    print(“Drop item: D”)

    print(“There is no puzzle to be solved.”)

    RAI = input(“Enter an action > “).strip()

    print()

    if RAI == “N”:

        roomc()

    elif RAI == “W”:

        roomb()

    elif RAI == “D”:

        if held_item is None:

            print(“You aren’t holding anything to drop.”)

        else:

            print(“You dropped the ” + held_item + “.”)

            bat_location = “rooma”

            held_item = None

        rooma()

    elif RAI == “P”:

        if held_item is not None:

            print(“You can’t pick up another object—you’re already holding something.”)

        elif bat_location != “rooma”:

            print(“There’s nothing here to pick up.”)

        else:

            held_item = “Baseball Bat”

            bat_location = “inventory”

            print(“You picked up the Baseball Bat.”)

        rooma()

    else:

        print(“Invalid action. Try N or W.”)

        rooma()

def roomb():

    global held_item

    global bat_location

    print(“You are in Mr. Goodman’s Room.”)

    if held_item is None:

        print(“You are holding no objects.”)

    else:

        print(“You are holding the ” + held_item + “.”)

    if bat_location == “roomb”:

        print(“The room has a Baseball Bat, which can be picked up. (P)”)

    else:

        print(“The room has no objects you can pick up.”)

    print(“Doors: E”)

    print(“Drop item: D”)

    print(“There is no puzzle to be solved.”)

    RAI = input(“Enter an action > “).strip()

    print()

    if RAI == “E”:

        rooma()

    elif RAI == “P”:

        if held_item is not None:

            print(“You can’t pick up another object—you’re already holding something.”)

        elif bat_location != “roomb”:

            print(“There’s nothing here to pick up.”)

        else:

            held_item = “Baseball Bat”

            bat_location = “inventory”

            print(“You picked up the Baseball Bat.”)

        roomb()

    elif RAI == “D”:

        if held_item is None:

            print(“You aren’t holding anything to drop.”)

        else:

            print(“You dropped the ” + held_item + “.”)

            bat_location = “roomb”

            held_item = None

        roomb()

    else:

        print(“Invalid action.”)

        roomb()

def roomc():

    global held_item

    global bat_location

    print(“You are in the Living Room.”)

    if held_item is None:

        print(“You are holding no objects.”)

    else:

        print(“You are holding the ” + held_item + “.”)

    if bat_location == “roomc”:

        print(“The room has a Baseball Bat, which can be picked up. (P)”)

    else:

        print(“The room has no objects.”)

    print(“The room has a note, which can be viewed. (V)”)

    print(“Doors: N E S”)

    print(“Drop item: D”)

    print(“There is no puzzle to be solved.”)

    RAI = input(“Enter an action > “).strip()

    print()

    if RAI == “N”:

        roomd()

    if RAI == “E”:

        for i in range(3):

            j = i + 1

            A = input(“Solve the basement lock (two numbers): “).strip()

            if A == “67”:

                print(“Correct password.”)

                print()

                roome()

            else:

                print(“Wrong password. You have ” + str(3 – j) + ” attempts left.”)

                print()

                if j == 2:

                    print(‘hint: remember the notes?’)

                    print()

                elif j == 3:

                    print(‘”Shoot, what can the password be?” you frantically say.’)

                    print(‘”Yes, what could it possibly be?” another voice replies.’)

                    print(‘”You see, I hate it when people are so curious.’)

                    print(‘Why not just mind your own business?” says the voice.’)

                    print(“You look back, and it’s Mr. Goodman, who hired you.”)

                    print(“He’s pointing a gun at you, and there’s nothing you can do…”)

                    print()

                    print(“Y O U  D I E D”)

                    print()

                    print(“G A M E  O V E R”)

                    print()

                    quit()

    if RAI == “S”:

        rooma()

    elif RAI == “V”:

            print(“First Letter…Basement..Lock…”)

            print(”                                “)

            print(”          00000000000           “)

            print(”        000000   000000         “)

            print(”      000000                    “)

            print(”     000000                     “)

            print(”     000000  0000000            “)

            print(”     000000000000000000         “)

            print(”     000000000    000000        “)

            print(”      0000000      000000       “)

            print(”       000000     000000        “)

            print(”         0000000000000          “)

            print(”           000000000            “)

            print()

            roomc()

    elif RAI == “D”:

        if held_item is None:

            print(“You aren’t holding anything to drop.”)

        else:

            print(“You dropped the ” + held_item + “.”)

            bat_location = “roomc”

            held_item = None

        roomc()

    elif RAI == “P”:

        if held_item is not None:

            print(“You can’t pick up another object—you’re already holding something.”)

        elif bat_location != “roomc”:

            print(“There’s nothing here to pick up.”)

        else:

            held_item = “Baseball Bat”

            bat_location = “inventory”

            print(“You picked up the Baseball Bat.”)

        roomc()

    else:

        print(“Invalid action.”)

        roomc()

def roomd():

    global held_item

    global bat_location

    print(“You are in Ethan’s Room.”)

    if held_item is None:

        print(“You are holding no objects.”)

    else:

        print(“You are holding the ” + held_item + “.”)

    if bat_location == “roomd”:

        print(“The room has a Baseball Bat, which can be picked up. (P)”)

    else:

        print(“The room has no objects.”)

    print(“The room has a note, which can be viewed. (V)”)

    print(“Doors: S”)

    print(“Drop item: D”)

    print(“There is no puzzle to be solved.”)

    RAI = input(“Enter an action > “).strip()

    print()

    if RAI == “S”:

        roomc()

    elif RAI == “V”:

            print(“Second Letter…Basement..Lock..”)

            print(”                                “)

            print(”       00000000000000000000     “)

            print(”       0000000000000000000      “)

            print(”                     0000       “)

            print(”                    0000        “)

            print(”                   0000         “)

            print(”                  0000          “)

            print(”                 0000           “)

            print(”                0000            “)

            print(”               0000             “)

            print(”              0000              “)

            print()

            roomd()

    elif RAI == “D”:

        if held_item is None:

            print(“You aren’t holding anything to drop.”)

        else:

            print(“You dropped the ” + held_item + “.”)

            bat_location = “roomd”

            held_item = None

        roomd()

    elif RAI == “P”:

        if held_item is not None:

            print(“You can’t pick up another object—you’re already holding something.”)

        elif bat_location != “roomd”:

            print(“There’s nothing here to pick up.”)

        else:

            held_item = “Baseball Bat”

            bat_location = “inventory”

            print(“You picked up the Baseball Bat.”)

        roomd()

    else:

        print(“Invalid action.”)

        roomd()

def roome():

    global held_item

    global bat_location

    print(“You are in the Stairs.”)

    if held_item is None:

        print(“You are holding no objects.”)

    else:

        print(“You are holding the ” + held_item + “.”)

    if bat_location == “roome”:

        print(“The room has a Baseball Bat, which can be picked up. (P)”)

    else:

        print(“The room has no objects.”)

    print(“Doors: W down”)

    print(“Drop item: D”)

    print(“There is no puzzle to be solved.”)

    RAI = input(“Enter an action > “).strip()

    print()

    if RAI == “W”:

        roomc()

    if RAI == “down”:

        roomf()

    elif RAI == “D”:

        if held_item is None:

            print(“You aren’t holding anything to drop.”)

        else:

            print(“You dropped the ” + held_item + “.”)

            bat_location = “roome”

            held_item = None

        roome()

    elif RAI == “P”:

        if held_item is not None:

            print(“You can’t pick up another object—you’re already holding something.”)

        elif bat_location != “roome”:

            print(“There’s nothing here to pick up.”)

        else:

            held_item = “Baseball Bat”

            bat_location = “inventory”

            print(“You picked up the Baseball Bat.”)

        roome()

    else:

        print(“Invalid action.”)

        roome()

def roomf():

    global held_item

    print(“You are in the Basement.”)

    print()

    print(“You see something at the end of the Basement.”)

    print()

    actone = input(“Enter 1 to approach, 2 to leave. > “).strip()

    if actone == “1”:

        print()

        print(“You walk towards the mysterious shadow.”)

        print(“As you get closer, you realize that it’s”)

        print(“What you have been looking for: Ethan,”)

        print(“the missing child.”)

        print()

        acttwo = input(“Enter 1 to talk to him, 2 to report to Mr. Goodman. > “).strip()

        if acttwo == “1”:

            print()

            print(‘”Ethan? So you were here the whole time! Your Dad is’)

            print(‘searching for you, he would be glad I found you.” you said.’)

            print(‘”Wait—dont take me back to my Dad!” Yelled Ethan.’)

            print(‘Confused, you ask why. “He was the one that forced me’)

            print(‘to stay in the basement.” replied Ethan. “He knew that I was’)

            print(‘here the entire time!” He said. “Wait, why did he hire me’)

            print(‘then?” you asked. “So that everybody thinks that Im missing.’)

            print(‘He knew that as long as you dont enter the basement, you wont’)

            print(‘be able to find me. And when even you, Detective James, fails’)

            print(‘to find me, everybody would think that Im missing.” said Ethan.’)

            print(‘”But why is he trying to hide you in the first place?” you asked.’)

            print(‘”Im supposed to move to my Moms house by next week, but he wants’)

            print(‘me to stay with him. Please, get me out of here.” Ethan begged.’)

            print(‘”Okay, lets get out of here.” you replied. But then another voice’)

            print(‘joined the conversation. “You see, I thought that I told you to not’)

            print(‘enter the basement, Detective James.” it was Mr. Goodman, who was’)

            print(‘now pointing a gun at my head.’)

            print()

            actthree = input(“Enter 1 to reach for a weapon. > “).strip()

            if actthree == “1”:

                if held_item == “Baseball Bat”:

                    print()

                    print(“You grab the baseball bat you found in Mr. Goodman’s room. You swing”)

                    print(‘the bat and hit Mr. Goodmans head, knocking him out. “Hurry, lets get’)

                    print(‘out of here.” You said. You and Ethan make it out of the house, and’)

                    print(‘call the police.’)

                    print()

                    print(“5 DAYS LATER”)

                    print()

                    print(“The police have arrested Mr. Goodman, Ethan went under the care of her mom,”)

                    print(‘and you solved another case. But thats when the phone rings—”Hello?”‘)

                    print(‘you answer. “Hello Detective James, seems like we have a case for you…”‘)

                    print()

                    print(“G A M E  C O M P L E T E D”)

                    print()

                    print(“T O  B E  C O N T I N U E D”)

                    quit()

                else:

                    print()

                    print(“You reached for a weapon, but you found nothing. You remember that”)

                    print(“there was a baseball bat in Mr. Goodman’s Room—but it’s too late.”)

                    print(‘”Dad…please dont…” begged Ethan. “Im sorry son. It has to be’)

                    print(‘done.” replied Mr. Goodman.’)

                    print()

                    print(“Y O U  D I E D”)

                    print()

                    print(“G A M E  O V E R”)

                    print()

                    quit()

        elif acttwo == “2”:

            print()

            print(“As you type Mr. Goodman’s number on the phone,”)

            print(“you realize that he’s standing right behind you.”)

            print(‘”You see, I thought that I told you to not’)

            print(‘enter the basement…” says Mr. Goodman.’)

            print(‘”Well, thank you for helping. You can go now.”‘)

            print(‘As soon as he finishes his sentence, he points a’)

            print(“gun on you—and you realize there’s nothing you can do.”)

            print()

            print(“Y O U  D I E D”)

            print()

            print(“G A M E  O V E R”)

            print()

            quit()

    elif actone == “2”:

        print()

        print(“As you turn around and exit the basement,”)

        print(“You encounter Mr. Goodman, the man who hired you.”)

        print(‘”You see, I thought that I told you to not’)

        print(‘enter the basement…” he says.’)

        print(‘”Well, thank you for helping. You can go now.”‘)

        print(‘As soon as he finishes his sentence, he points a’)

        print(“gun on you—and you realize there’s nothing you can do.”)

        print()

        print(“Y O U  D I E D”)

        print()

        print(“G A M E  O V E R”)

        print()

        quit()

rooma()