Thanks to a few guys on the forums I finally got around to starting on my text-based adventure called "a knights quest." It features a knight played by the player that is sent by his king to wipe out a cave full of foul creatures. However I am a bit stuck on how to simulate player movement in Python. I looked around the internet for movement logic specifically in Python, but so far I have had no luck. So I come to you guys, the experts. Does anyone have a good method of simulating player movement? In case anyone is interested I am 51% of the way through the CodeAcademy Python track so I haven't completely learned the basics of Python yet. Should I write a function? Or I heard of something called a class which I have yet to learn about yet. Here's my code below if anyone is interested in giving me tips on what I already have.
Thanks in advance,
# -*- coding: utf-8 -*-
Created on Sun Jun 2 17:29:40 2013
epicfailure = "Since you failed to type your own name you lose"
if len® > 0:
name = raw_input("What is your name?")
if printresponse(name) == True:
hometown = raw_input("Where are you from?")
helpint = "typable options: north, south, east, west, hit creature, run away, use torch"
if input == "help":
yournameintro = "<Your name is %s , a wearied traveler>" % (name)
yourhometownintro = "<You've been sent to a cave outside of %s by your king>" % (hometown)
yourquestintro = "<Wipe out all of the foul creatures that dwell there>"
caveentrance = "<As you enter the cave, you check your supplies. You have a sword, and a torch. You think to yourself 'My king is such a cheapskate'>"
thequestion = "<What do you do?>"
if printresponse(hometown) == True:
response = raw_input(thequestion)
Edited by mauermcx, 07 June 2013 - 09:23 AM.