Tutorial for creating a basic text adventure in python?

im very new to python, just started learning control flow and stuff. I started this game, well, not much from the game, but I just wanted to check what I found out, realized that this is better than just doing endless book exercises. do i have a right idea? I don’t think I am doing this, but it was fun to do it anyway. Feel free to tell me your garbage, they are not very attached to it: D also, is there a basic textbook for creating it?

thank.

EDIT: note features not yet implemented :)

hp = 30

print 'You enter a dark room with two doors. Do you want to enter door #1 or door #2?'
door = raw_input('> ')

if door == "1":
    print 'Theres a giant bear eating what appears to be a human arm, though its so damaged it\ hard to be sure'
    print 'what do you want to do?'
    print '#1 try to take the arm'
    print '#2 scream at the bear'

    bear = raw_input('> ')

    if bear == "1":
        print 'You approach the bear slowly, never breaking eye contact. After what feel like a thousand years you are finally face to face with the bear. \nYou grab the arm and pull. of course the bear responds by eating you face. well done!'

    elif bear == "2":
        print 'You scream at the bear, a decent sound as well. The bear however was not impressed it would seem \nas he insantly eats your face. Well done!'

    else:
        print 'Well, doing %s is probably better. Bear runs away.' % bear

elif door == "2":
    print 'You stare into the endless abyss of Bollofumps retina.'
    print 'Oh dear, seems the insanity of Bollofumps existence had driven you quite insane.'
    print '#1. drool'
    print '#2. scream and drool'
    print '#3. Understand the fabrics of molecula toy crafting'
    insanity = raw_input('> ')

    if insanity == "1" or "2":
        print 'Your body survives, powered by pure insanity!'

    else:
        print 'your mind melts into green flavoured jello! mmm!'

else:
    print 'you think for a while but suddenly a troll weilding a terrible looking knife comes through a trap door and shanks you!'
+3
source share
5 answers

Python Adventure Writing System (PAWS ). - PAWS " , . MS Word 2000 (Word 97), , , , head:), - ."

, Python ( Learn Python the Hard Way , " " ), , ( , ).

+5

! , , ; - , , .

- -, - , () . , , .

, , - (hp = 30). - , , , , - , ( ), . ( throne_room_with_green_switch_down throne_room_with_green_switch_up).

- - , 8 5 4 . - , , ; dragon_health , .

- - , - has_red_sword red_sword_damage has_blue_sword blue_sword_damage blue_sword_poison_applied blue_sword_damage_with_poison_applied... , , , , , rainbow_sword_of_dawn_damage? - , " " , .

, BlueSword RedSword, JeweledScepter GreenCup RedDragon, - . , RedSword GreenCup, RedDragon, RedSword JeweledScepter - , GreenCup - , BlueSword RedSword, JeweledScepter. - RedDragon - , , RedSword - , , JeweledScepter - , , .. , , , . - , 5 12 , 150-180 .

- !

+4
+2

QBasic . 2d , , IFs GOTO... 100% . ( , 10 , .)

[[1, 0, 0, 1],

[1, 1, 0, 1],

[0, 1, 1, 1],

[0, 0, 0, 1]]

?

x y. , robots.jpg.

- :

class Room:

exits = [1, 0, 1, 0]  #[W, N, E, S] - up to you, really.
description = "You see a tree"
objects...
etc.

2d, . ( , .)

, , Player, hitpoints, , ..

, , , , . , "" .

, , , , .

, , : " , , ". , , , . , . , , "". , .

.

+1

All Articles