本文整理汇总了Python中Level.Level.carve方法的典型用法代码示例。如果您正苦于以下问题:Python Level.carve方法的具体用法?Python Level.carve怎么用?Python Level.carve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Level.Level
的用法示例。
在下文中一共展示了Level.carve方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Level
# 需要导入模块: from Level import Level [as 别名]
# 或者: from Level.Level import carve [as 别名]
inittime = time.clock()
#World dimensions
width = 200
height = 200
#Inital spawn point of the player
playerx = 60
playery = 60
playercharacter = '@'
#inital level
level1 = Level(width, height)
level1.gen_base(playerx, playery)
level1.carve()
level1.player_room()
#Try to create "rooms" amount of randomly placed non-overlapping rooms
rooms = 30000
level1.gen_rooms(rooms)
board = level1.board
player = Player(playerx, playery, playercharacter, board)
def printboard():
#set the playercharacter to the board for drawing
board[player.y][player.x] = playercharacter