Hardware Reference
In-Depth Information
5. Define some dummy functions for all the features that this program needs to
have. You will fill in the detail of these soon:
def buildRoom(x, y, z):
print("buildRoom")
def demolishRoom():
print("demolishRoom")
def cleanRoom():
print("cleanRoom")
def listFiles():
print("listFiles")
def scan3D(filename, originx, originy, originz):
print("scan3D")
def print3D(filename, originx, originy, originz):
print("print3D")
6. The dummy menu function is special, because it returns a value at the end of the
function. For now, you can generate a random option and return it so that it is
possible to test the early versions of your program, but soon you will write a
proper menu here. You are writing a dummy menu so that you can test the struc-
ture of your program first, and you will soon fill this in with a proper menu:
def menu():
print("menu")
time.sleep(1)
return random.randint(1,7)
7. Write the main game loop that displays a menu then uses the function required
for that feature. See Digging into the Code for more information about how the
anotherGo variable is used:
anotherGo = True
while anotherGo:
choice = menu()
if choice == 1:
pos = mc.player.getTilePos()
buildRoom(pos.x, pos.y, pos.z)
elif choice == 2:
listFiles()
 
Search WWH ::




Custom Search