Suggestions
I'd make the code more structured, use the object-oriented aspect of the language.
Right now the code is very repetitive, I'd say copy-paste all over the place.
I think with the usage of classes, one could separate the game logic (entering a location, offering choices, acting on the user input) from the data (description of the location, available choices, consequences of the user actions).
This would make the code more readable and easier to extend.
Update
I've added a sample code to show what I mean by separating the game logic from the data using objects and functions.
import time
#
# Declaration of classes -- game logic
#
class Action:
def __init__(self, description, newLocation):
self.description = description
self.newLocation = newLocation
class Location:
def __init__(self, name, description):
self.name = name
self.description = description
self.actions = []
def addAction(self, action):
self.actions.append(action)
def arrive(self):
print("----------------------------------------")
print('You arrived to: {}'.format(self.name))
print(self.description)
i = 0
print(" (0. Exit game)")
for action in self.actions:
i = i + 1
print(" {}. {}".format(i, action.description))
validChoice = False
while not validChoice:
try:
index = int(input("? : "))
if index == 0:
print("Abandoning your quest... :(")
return
if 0 < index and index <= len(self.actions):
validChoice = True
except ValueError:
pass
self.actions[index - 1].newLocation.arrive() # indexing is 0-based, but we get 1-based index from the user
#
# Declare your locations here -- data
#
house = Location("house", "Inside the house there is a sweet aroma of rolls being baked.")
field = Location("field", "Grass swishes as you walk through it. a solitary horse is grazing in the field.")
stable = Location("stable", "You are greeted by the sound of various animal noises and the smell of various animal odors")
spawnPosition = Location("Spawn position", "You wake up in a sunny morning. After you get out of your bad, you decide to:")
spawnPosition.addAction(Action("go to the house", house))
spawnPosition.addAction(Action("walk the fields", field))
spawnPosition.addAction(Action("visit the stable", stable))
#
# The game starts here
#
print ("Cool Cousins Studios Presents...")
time.sleep(2) # Sleep for 2 seconds
print ("With use of Python Code...")
time.sleep(2) # Sleep for 2 seconds
print ("Adventure In Saldica")
time.sleep(2) # Sleep for 2 seconds
print ("(cue dramatic music)")
time.sleep(3) # Sleep for 3 seconds
spawnPosition.arrive() # This is all you need to do to initiate the game. When this function returns, your journey has concluded.
print("Bye-bye")