Hello everyone, I just started with the book 'Learning Python the hard way' by Zed A. Shaw,and I have to say that it is really fun to learn code. I thought that it would be a problem because I'm 15,but I'm understanding it pretty well so far.
Anyway,enough of the chitchat. I have a question with my first test-game,I'll put the code in here for it too.
It's still pretty short and I'm writing it with rooms,like room1,room2 etc.
Now my question is,if there is any kind of inventory or such.
I want to make the player find a rope(seil) and then use it on an abyss in the jungle(jungel),the problem is,the rope/seil is in another room.
I wrote,that the seil is false,until it is picked up by the player. After picking it up,the rope becomes True and can't be picked up anymore.
I'm also trying to make the same room twice,in this case the jungle,so you have diffrent dialoques when walking from A to B and B to A.
I'm trying to get the player find a radio with no batteries,then he has to find a rope,to get through the jungle to the other side,to find the batteries.If he has the batteries and the radio,he combines them,calls a rescue team and gets rescued in a new version of the room 'wrack'.
I hope it's not to complicated.
- When I go back to the room,will the rope be there again,even after picking it up?
- Can I use the picked up rope in another room?
- If yes,how?
Sorry for my bad english,and that the code is written in german. But you should probaply understand most of it.
If you have questions about it,please ask me. I'd love to get answers,criticism or tips.
Thanks.
from sys import exit
def wrack_rettung():
print "Du entdeckst das Rettungsteam und deren Hubschrauber."
print "Als du angelatscht kommst,wirst du mit Kaffee und einer Decke versorgt."
print "Du steigst in den Helikopter und fliegst wieder nach Hause. Du hast gewonnen!"
def wrack():
print "Als du naeher zum Wrack kommst, riechst du das verbrannte Kerosin."
print "Was tust du als naechstes?"
print "1. Untersuche das Wrack"
print "2. Gehe wieder zum Strand"
print "3. Ruf nach Hilfe"
funk = False
while False:
next = raw_input("> ")
if next == "2":
start()
elif next == "1" and funk:
print "Du findest ein Funkgeraet ohne Batterien,und steckst es ein."
print "Was tust du nun?"
funk = True
elif next == "1" and not funk:
print "Es gibt nichts mehr zu untersuchen."
elif next == "3":
print "Du rufst verzweifelt nach Hilfe, doch du scheinst alleine zu sein."
print "Was tust du?"
else:
print "Bitte antworte mit 1, 2 oder 3"
def bucht():
print "Du siehst dich um und siehst ein Seil in der Ferne liegen."
print "Wie sieht dein Plan aus?"
print "1. Nimm das Seil"
print "2. Geh wieder zum Strand"
seil = False
while False:
next = raw_input("> ")
if next == "1" and seil:
print "Du steckst das Seil ein."
seil = True
elif next == "1" and not seil:
print "Du hast das Seil bereits eingesteckt."
print "Was tust du?"
elif next == "2":
start()
def strand_nach_jungel():
print "Du betretest den tiefen Jungel und hoerst diverse Tier-Geraeusche."
print "1. Geh tiefer in den Jungel hinein"
print "2. Ruf nach Hilfe"
print "3. Geh wieder zum Strand"
next = raw_input(" >")
if "1":
print "Du gehst tiefer in den Jungel hinein und stehst aufeinmal vor einem Abgrund."