本文整理汇总了Python中Grid.Grid.shouldDrawScreen方法的典型用法代码示例。如果您正苦于以下问题:Python Grid.shouldDrawScreen方法的具体用法?Python Grid.shouldDrawScreen怎么用?Python Grid.shouldDrawScreen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Grid.Grid
的用法示例。
在下文中一共展示了Grid.shouldDrawScreen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: worldUpdate
# 需要导入模块: from Grid import Grid [as 别名]
# 或者: from Grid.Grid import shouldDrawScreen [as 别名]
grid.cellMatrix[singular_preyoffspring.gridX][singular_preyoffspring.gridY].offspring = singular_preyoffspring
singular_preyoffspring.update()
if(showDisplay):
pygame.display.update()
clock.tick(10)
worldAge = 0
endAge = worldAge + 50000
while not done and worldAge < endAge:
# --- Main event loop
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
grid.shouldDrawScreen = False
worldUpdate(grid.shouldDrawScreen)
if worldAge % 10000 == 0:
preyAdultKeys = PreyAdult.dictionaryOfPreyAdults.keys()
for preyAdultPosition in preyAdultKeys:
singular_prey = PreyAdult.dictionaryOfPreyAdults[preyAdultPosition]
print "{:d}, e: {:0.2f}, W: {:d}, L: {:d}, CP: {:d}"\
.format(worldAge, singular_prey.ai.epsilon, singular_prey.fed, singular_prey.eaten, singular_prey.offspringsProtected)
singular_prey.eaten = 0
singular_prey.fed = 0
singular_prey.offspringsProtected = 0
worldAge += 1
while not done: