Table of Contents
Abstract…………………………………………………………………………………………..Page 3
Introduction………………………………………………………………………………………Page 4
The Program…………………………………………………………………………………….Page 5
Screenshots
Source Code
Conclusion
References
Abstract
A text-based adventure game compiled and created using simple Python and additional modules from www.Pygame.com it is sort of inspired by early interactive fiction games like Zork and Colossal Cave Adventure. Although, it is sparse on story, it has taught me to utilize many things I learned about programming to good use.
Introduction
I have been learning to program in Python …show more content…
def makePlayer(): player["name"] = raw_input("Name your character: ") print "\nYour character is named %s. Your health is full (%s hp), and you currently hold %s gold pieces. You inventory is empty." % (player["name"], player["health"],player["gold"]) print "\t%s is a 1st level character, who needs %s xp to gain a level. Doing so will lead to more health. You get xp from exploring and overcoming encounters." % (player["name"],player["xpForNextLevel"]) print "\tYou set out from your home town of The Shire in search of fortune and …show more content…
TILE# " + str(player["locationID"])
# move around the map. def movePlayer(direction): if direction == "n": if player["locationY"] + 1 <= 4: player["locationY"] += 1 player["locationID"] += 5 else: player["locationY"] = 0 player["locationID"] = (player["locationID"]+5)-25 elif direction == "s": if player["locationY"] - 1 >= 0: player["locationY"] -= 1 player["locationID"] -=5 else: player["locationY"] = 4 player["locationID"] = (player["locationID"]-5)+25 elif direction == "e": if player["locationX"] + 1 <= 4: player["locationX"] += 1 else: player["locationX"] = 0 if (player["locationID"] + 1) <= (player["locationY"]+1)*5: player["locationID"] += 1 else: player["locationID"] -= 4 else: # direction == "w" if player["locationX"] - 1 >=