Jump to content

  • Log In with Google      Sign In   
  • Create Account


mauermcx

Member Since 16 May 2013
Offline Last Active Jul 26 2013 07:41 AM
-----

Topics I've Started

Movement Game Logic in a Python Text-Based Game

07 June 2013 - 09:21 AM


 

Hey all,
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,
Michael

 

 

 


# -*- coding: utf-8 -*-
"""
Created on Sun Jun  2 17:29:40 2013
 
@author: Michael
"""
epicfailure = "Since you failed to type your own name you lose"
def printresponse®:
    if len® > 0:
        return True
    else:
        return False
 
name = raw_input("What is your name?")
if printresponse(name) == True:
    hometown = raw_input("Where are you from?") 
else:
    print epicfailure  
def help(input):
    helpint = "typable options: north, south, east, west, hit creature, run away, use torch"
    if input == "help":
        print helpint
 
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:
    print yournameintro
    print yourhometownintro
    print yourquestintro
else:
    print epicfailure    
print "======================="    
print caveentrance
print "======================="
print thequestion
help("help")
response = raw_input(thequestion)
 

Need help with programming a text adventure game in python (New Programmer)

16 May 2013 - 03:35 PM

Hi all,

I'm new to the forum as well as game development.  I would like to know first and foremost the process of creating a text-based adventure game with Python.  I have almost no experience with the language and I would like this to be my first program because of my love for text games.  Would anyone be able to give me a run-down of what the skeleton might look like? Nothing too complex at all.... but just some tips and strategies for a first time game developer.  

 

Your help is much appreciated,

Michael Auer


PARTNERS