[mdlug] MDLUG Game Project spacemaze
Gib
gibmaxn at gmail.com
Sun Feb 10 14:35:44 EST 2019
I've attached the early, draft version of a program. We can use this
to discuss our project.
-------------- next part --------------
#common varibles
#global aliveflag
aliveflag = "true" # Is the player alive? true = alive, false = dead
def rooma001 ():
print ("rooma001")
print ("You fell in a hole and died")
global aliveflag
aliveflag = "false"
print ("bottom of rooma001", aliveflag)
return
def rooma002 ():
print ("rooma002")
print ("You are in a room with metal floor and three openings. To the west is a entryway to a control room. To the north is a room with a green light. To the east is a dark room")
print ("enter e w n s to move east west north south")
nextmove = input ("Enter next move")
if nextmove == "e":
print ("e")
roomb001()
if nextmove == "w":
print ("w")
roomb002()
if nextmove == "n":
print ("n")
roomb003()
if nextmove == "s":
print ("s")
roomb004()
return
def rooma003 ():
print ("rooma003")
return
def rooma003 ():
print ("rooma003")
return
def rooma004 ():
print ("rooma004")
return
#
def roomb001 ():
print ("roomb001")
print ("You fell in a hole and died")
aliveflag = "false"
return
def roomb002 ():
print ("roomb002")
print ("You found a control center")
# aliveflag = "false"
return
def roomb003 ():
print ("roomb003")
print ("You fell in a hole and died")
aliveflag = "false"
return
def roomb004 ():
print ("roomb004")
print ("You fell in a hole and died")
aliveflag = "false"
return
#
#main
print ("This is Spacemaze 2/9/2019 a project of mdlug.org")
print ("You are in a room with dirt floor and three openings. To the west is a entryway to a dark area. To the north is a room with a green light. To the east is a dark room")
print ("enter e w n s to move east west north south")
#global aliveflag
#aliveflag = "true"
nextmove = input ("Enter next move")
if nextmove == "e":
print ("e")
rooma001()
elif nextmove == "w":
print ("w")
rooma002()
elif nextmove == "n":
print ("n")
rooma003()
elif nextmove == "s":
print ("s")
rooma004()
#
print ("You have returned to the main room", aliveflag)
if aliveflag == "true":
# print (aliveflag)
print ("You are alive")
else:
print ("You are not alive")
print ("End of Game")
More information about the mdlug
mailing list