本文整理匯總了Python中GUI.terrain_display方法的典型用法代碼示例。如果您正苦於以下問題:Python GUI.terrain_display方法的具體用法?Python GUI.terrain_display怎麽用?Python GUI.terrain_display使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GUI
的用法示例。
在下文中一共展示了GUI.terrain_display方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: main
# 需要導入模塊: import GUI [as 別名]
# 或者: from GUI import terrain_display [as 別名]
def main():
print("starting")
gui = GUI()
gui.terrain_display()
world = World(gui)
obj_under_monitor = None
pace = Epace.stop
while True:
command = gui.get_command()
if command not in ['None','Null']:
gui.show_message(command[0])
if command == "exit":
gui.field.close()
gui.control.close()
gui.monitor.close()
del gui
#del world
break
elif command == 'save':
world.save()
elif command == 'load':
world.load()
elif command == 'rules':
gui.show_message(world.check_rules())
elif command == 'clock':
pace = Epace.single
elif command == 'pause':
pace = Epace.stop
elif command == 'go':
pace = Epace.go
elif command == 'restart':
world.start()
if command[0] == 'field': # click in field detected
if world.grid_[command[1]][command[2]].single_cell__ is not None:
obj_under_monitor = world.grid_[command[1]][command[2]].single_cell__
else:
obj_under_monitor = world.grid_[command[1]][command[2]]
if obj_under_monitor is not None:
gui.show_point_info(serialise(obj_under_monitor))
if pace in [Epace.single, Epace.go]:
world.tick()
if pace == Epace.single:
pace = Epace.stop