本文整理汇总了Python中Level.Level.draw_floor方法的典型用法代码示例。如果您正苦于以下问题:Python Level.draw_floor方法的具体用法?Python Level.draw_floor怎么用?Python Level.draw_floor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Level.Level
的用法示例。
在下文中一共展示了Level.draw_floor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: World
# 需要导入模块: from Level import Level [as 别名]
# 或者: from Level.Level import draw_floor [as 别名]
#!/usr/bin/env python3
"""Basic player control, wall/collision sensing, and goal reaching"""
import random
import time
from World import World
from Level import Level
from Player import Player
world = World()
tk = world.root # xxx replace with a world.refresh()-ish method later
level = Level(world)
level.draw_floor()
# outer box of walls
for x in range(world.scale()):
for y in [0, world.scale()-1]:
level.put_wall(x, y)
level.put_wall(y, x)
# some interior walls
for x in range(2, world.scale() ,3):
for y in range(2, world.scale(), 3):
level.put_wall(x, y)
level.put_wall(y, x)
# goal in the bottom right
level.put_goal(world.scale() - 2, world.scale() - 2)