A text based game review

A text based game review

Postby Elot1134 » Sat Jun 21, 2014 8:37 pm

Hi I'm new to all this programming in python but i already know JavaScript and HTML. Today i finished a game I've been working on and i wanted to know what people think of it and how i can make it better! Here's the code (i'ts a text based game') :

Code: Select all
import time
print('(NOTE: This is a text based game. Only enter either 1 or 2 to make your choice.)')
print('')

print('You awake in a strange shack,')
print('you have no memory of the night before.')
print('You feel sleepy, but you have a choice to make.')
choice1 = input('Will you 1: Continue to sleep, or 2: Get up and explore?')
if choice1== 1:
    print('')
    print('You awake later that day.')
    print("It's around 8pm,")
    print('when you hear a knock on the door.')
    choice2 = input('Will you 1: Open the door or 2: Continue to sleep?')
    if choice2== 2:
        print('')
        print('You continue to sleep,')
        print('but you never wake up.')
    else:
        print('')
        print('You get up to open the door.')
        print('The door opens before you take one step.')
        print('Theres a short man, cloaked')
        print('in a black mist, a hood covering his face.')
        choice3 = input('Will you 1: Shout "Dont kill me you bastard!" or 2: ask "Who or what are you?"')
        if choice3== 1:
                print('')       
                print('The short man raises his arm,')
                print('you fall asleep instantly.')
                print('You never wake up.')
        else:
            print('')
            print('The short man raises his arm')
            print('revealing a piece of paper.')
            print('He then drops it on the floor, then vanishes instantly.')
            choice4 = input('Will you 1: Read the paper, or 2: Go back to sleep?')
            if choice4== 2:
                print('')
                print('You fall asleep again,')
                print('never to wake up.')
            else:
                print('')
                print('You pick up the paper.')
                print('It reads: Sp*テy*|okn*~rs}6*テy1タo*m|kmuon*')
                print('          ~ro*myno+*Rkrk*チovv*nyxo6*l~*}y||テ*')
                print('          ~y*ns}}kzysx~*テy6*~rs}*s}*')
                print('          xy~rsxq*}zomsov6*}y||テ*D9')
                print('You have no idea what this means!')
                print('What will you do?')
                choice5 = input('Will you 1: Just sleep or 2: Walk outside?')
                if choice5== 1:
                    print('')
                    print('You fall asleep.')
                    print('You will never wake up.')
                else:
                    print('')
                    print('You walk outside.')
                    print('It is pitch black and you cant see a thing.')
                    print('You see a light.')
                    choice6 = input('Will you 1: Go inside or 2: Walk towards it?')
                    if choice6== 1:
                        print('')
                        print('You walk back inside, ')
                        print('you stop suddenly.')
                        print('You are dead.')
                    else:
                        print('')
                        print('You walk towards the light')
                        print('but are stopped by a tap on the back.')
                        print('You turn around.')
                        print("It's the short guy again!")
                        print('He points to the paper.')
                        choice7 = input('Will you 1: Not give hime the paper or 2: Give him the paper?')
                        if choice7== 1:
                            print('')
                            print('You Die')
                        else:
                            print('')
                            print('You hand him the paper')
                            print('and he hands you a basket!')
                            print('It turns out that your piece of paper')
                            print('was a coupon for...')
                            time.sleep(2)
                            print('a basket of cookies!')
                            print('You remember what happened')
                            print('last night!')
                            print('You bargained your soul for')
                            print('a coupon of cookies!')
                            time.sleep(2)
                            PRINT('')
                            print('THE END')
else:
    print('')
    print('You walk outside.')
    print("It's about 12 pm")
    print('You see some trees!')
    choice8 = input('Will you 1: Go towards them or 2: Go back inside and sleep?')
    if choice8== 1:
          print('')
          print('As you walk towards them')
          print('you fall down a hole')
          print('and break your neck.')
          print('You die')
    else:
        print('')
        print('You awake later that day.')
        print("It's around 8pm,")
        print('when you hear a knock on the door.')
        choice2 = input('Will you 1: Open the door or 2: Continue to sleep?')
        if choice2== 2:
            print('')
            print('You continue to sleep,')
            print('but you never wake up.')
        else:
            print('')
            print('You get up to open the door.')
            print('The door opens before you take one step.')
            print('Theres a short man, cloaked')
            print('in a black mist, a hood covering his face.')
            choice3 = input('Will you 1: Shout "Dont kill me you bastard!" or 2: ask "Who or what are you?"')
            if choice3== 1:
                    print('')       
                    print('The short man raises his arm,')
                    print('you fall asleep instantly.')
                    print('You never wake up.')
            else:
                print('')
                print('The short man raises his arm')
                print('revealing a piece of paper.')
                print('He then drops it on the floor, then vanishes instantly.')
                choice4 = input('Will you 1: Read the paper, or 2: Go back to sleep?')
                if choice4== 2:
                    print('')
                    print('You fall asleep again,')
                    print('never to wake up.')
                else:
                    print('')
                    print('You pick up the paper.')
                    print('It reads: Sp*テy*|okn*~rs}6*テy1タo*m|kmuon*')
                    print('          ~ro*myno+*Rkrk*チovv*nyxo6*l~*}y||テ*')
                    print('          ~y*ns}}kzysx~*テy6*~rs}*s}*')
                    print('          xy~rsxq*}zomsov6*}y||テ*D9')
                    print('You have no idea what this means!')
                    print('What will you do?')
                    choice5 = input('Will you 1: Just sleep or 2: Walk outside?')
                    if choice5== 1:
                        print('')
                        print('You fall asleep.')
                        print('You will never wake up.')
                    else:
                        print('')
                        print('You walk outside.')
                        print('It is pitch black and you cant see a thing.')
                        print('You see a light.')
                        choice6 = input('Will you 1: Go inside or 2: Walk towards it?')
                        if choice6== 1:
                            print('')
                            print('You walk back inside, ')
                            print('you stop suddenly.')
                            print('You are dead.')
                        else:
                            print('')
                            print('You walk towards the light')
                            print('but are stopped by a tap on the back.')
                            print('You turn around.')
                            print("It's the short guy again!")
                            print('He points to the paper.')
                            choice7 = input('Will you 1: Not give hime the paper or 2: Give him the paper?')
                            if choice7== 1:
                                print('')
                                print('You Die')
                            else:
                                print('')
                                print('You hand him the paper')
                                print('and he hands you a basket!')
                                print('It turns out that your piece of paper')
                                print('was a coupon for...')
                                time.sleep(2)
                                print('a basket of cookies!')
                                print('You remember what happened')
                                print('last night!')
                                print('You bargained your soul for')
                                print('a coupon of cookies!')
                                time.sleep(2)
                                PRINT('')
                                print('THE END')
                           
                  
Last edited by micseydel on Sat Jun 21, 2014 8:59 pm, edited 1 time in total.
Reason: First post lock.
Elot1134
 
Posts: 9
Joined: Sat Jun 21, 2014 8:29 pm

Re: A text based game review

Postby Mekire » Mon Jun 23, 2014 12:48 am

The only real suggestion I can give you here is to start learning about functions.
Currently your entire program is basically copied and pasted twice (in the main if and else block). This should be a huge red flag to you that you need to change your design.

You can also do this with your input. You only ask questions with two choices. This is the perfect opportunity to use a function.

-Mek
User avatar
Mekire
 
Posts: 988
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan


Return to Game Development

Who is online

Users browsing this forum: No registered users and 2 guests