Text Adventure Game in Python I'm currently working on a text adventure game for my first project. I am a beginner so I am seeking help with my code. Please comment any tips and general help regarding with making my code better, faster or more organised! I only started Python two weeks ago so any help would be greatly appreciated. I decided to only submit the code for the first room as I don't want to submit too much code at once.

health = 100
coins = 0
tutorial = True
gameStart = False
death  = False
spawn = True
livingRoom = False
Bathroom = False
Bedroom = False
Kitchen = False
wardrobeSpawn = False
spawnStart = True
telev = False


def countCoins():
    print
    print("You have: " + str(coins) + " coins")


while gameStart == True:
    if spawn == True:
        if spawnStart == True:
            print
            print(bcolors.FAIL + "You wake up in a room you don't 
recognise, with no idea how you got there")
            print
            print(bcolors.ENDC + "You look around and see a wardrobe 
and a door")
            spawnStart = False
        elif spawnStart == False:
            print
            spawnIn = raw_input("")
            spawnIn = spawnIn.lower()
            if spawnIn == "coins":
                countCoins()
                spawnStart = False
            elif spawnIn == "wardrobe":
                if wardrobeSpawn == False:
                    print
                    print "The wardrobe seems quite empty, but you do 
find a coin in the far left corner, you put it in your pocket"
                    print
                    coins += 1
                    wardrobeSpawn = True
                    spawnStart = False
                elif wardrobeSpawn == True:
                    print "This wardrobe looks oddly familiar, you have 
already explored it"
                    print
                    spawnStart = False
            elif spawnIn == "door":
                print
                print ("You walk out the door")
                print
                spawn = False
                livingRoom = True
            elif spawnIn == "look":
                print("You look around and see a wardrobe and a door")
                print
                spawnStart = False
            else:
                print("That is an unvalid command. Try again")
                print
                spawnStart = False
Bugs

In CountCoins:

print


... has no effect. The same applies to other parts of your code where you used this. If you meant to print a newline, use print() instead. You've also used print inconsistently, sometimes just leaving out the parentheses. Your tags include python-3.x, so you should fix that.

raw_input("")


... there's no such thing as raw_input in Python 3. I'm starting to think you've used a wrong tag.

Comparisons to True

Python automatically compares to True in if / elif / else / while statements. Therefore, you can shorten this:

while gameStart == True:

if spawn == True:

if spawnStart == True:


... to this:

while gameStart:

if spawn:

if spawnStart:


... what this also means is that instead of writing:

if wardrobeSpawn == False


... you can write:

if not wardrobeSpawn:


... which is shorter and more readable.

F-strings

Instead of doing:

print("You have: " + str(coins) + " coins")


You might want to use a so-called f-string:

print(f"You have {coins} coins")


This is easier for you and other developers.
f-strings are only available in Python 3.6 and later.

Functions

You seem to be using just one function. I suggest splitting the game up into several functions, perhaps like this:

def Level1():
    print("You wake up ...")

def Choice1()

def Choice2()


Styling

You should definitely read PEP8.
It states that you should, for example, use snake_case for variables and function names. Also, you should leave enough whitespace in between blocks of code to make it easier to read and manage. Really, take a look, it's a good read.