Today I finished the basic coding of my game. Here is the code.
print '''ooooo ooooo .oooooo. ooo ooooo oooooooooooo .oooooo..o ooooo .oooooo. oooo oooo `888' `888' d8P' `Y8b `88. .888' `888' `8 d8P' `Y8 `888' d8P' `Y8b `888 .8P' 888 888 888 888 888b d'888 888 Y88bo. 888 888 888 d8' 888ooooo888 888 888 8 Y88. .P 888 888oooo8 `"Y8888o. 888 888 88888[ 888 888 888 888 8 `888' 888 888 " `"Y88b 888 888 888`88b. 888 888 `88b d88' 8 Y 888 888 o oo .d8P 888 `88b ooo 888 `88b. o888o o888o `Y8bood8P' o8o o888o o888ooooood8 8""88888P' o888o `Y8bood8P' o888o o888o''' #Game start game_status = 0 while game_status == 0: start_command = raw_input('\nPress enter to start') if start_command == '': game_status = 1 #Super secret values to use for later hope = 5 keys = 0 completion = 0 #Intro if game_status == 1: #Typewriter effect (Thanks Stackoverflow) import sys from time import sleep words = '\n. . . ' for char in words: sleep(0.3) sys.stdout.write(char) sys.stdout.flush() words2 = '\nWhere are you? ' for char in words2: sleep(0.2) sys.stdout.write(char) sys.stdout.flush() words3 = "\n. . . . . \n" for char in words3: sleep(0.4) sys.stdout.write(char) sys.stdout.flush() print '\nYou woke up in a small, dark room. There is a ' + '\033[1m' + 'computer' + '\033[0m' + ', a '\ + '\033[1m' + 'mirror' + '\033[0m' + ', and a ' + '\033[1m' + 'small cabinet.' + '\033[0m' game_status = 2 while game_status == 2: #First interaction action = raw_input('What do you check in the room? ') if action.lower() == 'mirror': print '\nYou look into a mirror. There is a small note near the bottom. It reads: ' + '\033[1m' + \ 'A1Z26' + '\033[0m' + '\n' elif action.lower() == 'small cabinet' or action.lower() == 'cabinet': print '\nThere are papers scattered on top of the cabinet. You shuffle through them until you find one \ with \'key\' written on it.\nThere is only one key: ' + '\033[1m' + '22-1-7-1-2-15-21-14-4\n' + '\033[0m' elif action.lower() == 'computer': print '\nYou turn on the computer.' password_guess = raw_input('Enter password: ') if password_guess.lower() == 'vagabound': game_status = 3 else: print '\033[1m' + 'Incorrect password\n' + '\033[0m' hope -= 1 if hope == 0: game_status = 15 if game_status == 3: #Second interaction readme_status = bool keys_status = bool world_lock_status = bool vgnr_ky_status = bool print '\nYou gained access to the computer. There are four files on the desktop.\n' print '\033[0m' + '''readme keys safe_secret vgnr_ky\n''' while game_status == 3: if readme_status == True and keys_status == True and world_lock_status == True and vgnr_ky_status == True: game_status = 4 else: action2 = raw_input('Open a file: ') if action2.lower() == 'readme': print '''\nHello. If you\'re reading this, it\'s already too late. You\'ve been trapped here for very long. When will you realize? You\'ll never leave. You can\'t. Every mistake you make will cost you. There is no way back home.\n''' readme_status = True elif action2.lower() == 'keys': print '''\n815135 3 18 22 LIMBO\n''' keys_status = True elif action2.lower() == 'safe_secret' and completion == 0: print '\n' + '' + '\033[1m' + 'Access denied.\n' + '\033[0m' world_lock_status = True elif action2.lower() == 'safe_secret' and completion == 2: #secret thing print '482543' elif action2.lower() == 'vgnr_ky': print ''' #(&%&>'@($%^6(!+h$*&%-_^!* @*$(%@)>@#o$^:>@&#_#&^+_%@ )(86(@(`^*@&($+<_)_m(&$4@> @*%#*3e+_~@":>%@y{@&"~|{:.\n''' vgnr_ky_status = True #Third interaction if game_status == 4: from time import sleep print 'So you finally made it.' sleep(2) print 'Now you are ready to begin your journey.' sleep(3) print '* * * * * * * *\nYou find yourself on an open field.\nYou see some ' + '\033[1m' + 'docks ' '\033[0m' \ + 'and a ' + '\033[1m' + 'small village.' + '\033[0m' action3 = raw_input('Where do you go? ') while action3.lower() not in ('docks', 'small village', 'village'): action3 = raw_input('Where do you go? ') if action3.lower() == 'docks': game_status = 5 if action3.lower() == 'village' or action3.lower() == 'small village': game_status = 6 if game_status == 6: #village print 'You head to the village and find nobody in it. Only two buildings light up the darkness, a \n'\ + '\033[1m' + 'tower' + '\033[0m' + ', and a building that reads: ' + '\033[1m' + 'Memory Bank' + '\033[0m' action4 = raw_input('Which building do you visit? ') if action4.lower() == 'bank' or action4.lower() == 'memory bank': game_status = 7 if action4.lower() == 'tower': game_status = 8 if game_status == 7: #Memory bank safe_status = True print '\nYou make your way into the bank and see a giant safe. There is a 6 digit code needed to unlock it' while safe_status == True: lock_code = raw_input('Enter code: ') if lock_code == '815135': print 'You opened the safe and found a key! You head back to the village.' keyloop_prevent = 0 if keyloop_prevent == 0: keys += 1 keyloop_prevent += 1 action6 = raw_input('\nGo to the lighthouse or tower? ') if action6.lower() == 'lighthouse': game_status = 9 if action6.lower() == 'tower': game_status = 8 else: action5 = raw_input('The code didn\'t work. Go back to the village? ') if action5.lower == 'no' or action5.lower() == 'n': safe_status = True elif action5.lower() == 'yes' or action5.lower() == 'y': safe_status = False hope -= 1 if hope == 0: game_status = 15 action6 = raw_input('Go to the lighthouse or tower? ') if action6.lower() == 'lighthouse': game_status = 9 if action6.lower() == 'tower': game_status = 8 if game_status == 8: #tower print 'You enter the tower and start making your way up. A dimly lit computer is in the way.' action7 = raw_input('Read it? ') if action7.lower() == 'yes' or action7.lower() == 'y': #Computer print '*#*@(%&(*#@$#*' sleep(0.1) print '$*@(%&#@(%)#&@' sleep(0.1) print ')@(!*^&@^*#^$!' sleep(0.1) print '^@(*&@^%$@^&$#' sleep(1) password_guess2 = raw_input('En#t%Er pS$S@Awo)RD: ') if password_guess2 == 'LIMBO': print 'Game over' else: pass_attempts = 0 pass_attempts +=1 if pass_attempts == 5: print 'The computer shut down.' completion += 1 if action7.lower() == 'no' or action7.lower() == 'n': print 'You end up on the top of the tower. There\'s nothing else in the room except for a small, shiny object.' print 'You got a key! You head down to the docks.' keyloop_prevent2 = 0 if keyloop_prevent2 == 0: keys += 1 keyloop_prevent2 += 1 if keyloop_prevent2 == 1: game_status = 9 game_status = 9 if game_status == 5: #docks print 'You\'re at the docks. There is a ' + '\033[1m' + 'shed' + '\033[0m' + 'and a ' + '\033[1m' + 'pier' action8 = raw_input('Which one do you go to? ') if action8.lower() == 'shed': game_status = 10 if action8.lower() == 'pier': if boatengine == 1: game_status = 11 else: print 'There\'s a broken boat here. Somebody else is also here.' sleep(2) print 'He turns around.' words4 = '\nHey! Please help me fix up my boat! I\'ll take you anywhere in return.' for char in words: sleep(0.1) sys.stdout.write(char) sys.stdout.flush() print 'You don\'t have anything to fix the boat. You enter the shed to search for something that might work.' if game_status == 10: #shed locker_status = 0 print 'Inside the shed, there is a small locker. ' while locker_status == 0: password_guess3 = raw_input('Enter first number: ') if password_guess3 == '3': safe_status2 = 1 else: hope -= 1 if hope == 0: break game_status = 15 while locker_status == 1: password_guess4 = raw_input('Enter second number: ') if password_guess4 == '18': safe_status2 = 2 else: hope -=1 if hope == 0: break game_status = 15 while locker_status == 2: password_guess5 = raw_input('Enter final number: ') if password_guess5 == '22': print 'Inside the locker, there was a boat engine!' boatengine = 1 print 'You head to the pier' game_status = 11 else: hope -=1 if hope == 0: break game_status = 15 if game_status == 11: #docks completed words5 = 'Oh! An engine! Thanks to you, I can use this boat! I can take you across the harbour, or name any other place you want to go!' for char in words: sleep(0.1) sys.stdout.write(char) sys.stdout.flush() destination = raw_input('Where to? (Across the harbour / ???) ') while destination.lower() not in ('domum', 'across the harbour'): destination_repeat = raw_input('Sorry, didn\'t catch that. Where to? (Across the harbour / ???)') if destination.lower() or destination_repeat.lower() == 'across the harbour': game_status = 12 if hope == 0: game_status = 15 if game_status == 12: print '''You crossed the harbour. At the horizon was a huge a giant door with two keyholes.''' if keys == 0: print 'There was no way in. But you have done your part. The journey home begins.' elif keys == 1: print 'You were able to fit one key in, but there was nothing for the other keyhole. There was no way in. But you have done your part. The journey home begins.' elif keys == 2: print 'You placed both keys in. The door is unlocked.' if game_status == 15: print '\033[1m' + 'GAME OVER' + '\033[0m' |
Now that the framework is done, I plan on testing this game out with my friends and improving the coding. I also need to add in the secret stuff