本文整理汇总了Python中Graphics.playerInput方法的典型用法代码示例。如果您正苦于以下问题:Python Graphics.playerInput方法的具体用法?Python Graphics.playerInput怎么用?Python Graphics.playerInput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Graphics
的用法示例。
在下文中一共展示了Graphics.playerInput方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: exec
# 需要导入模块: import Graphics [as 别名]
# 或者: from Graphics import playerInput [as 别名]
MAP=open(fileName, 'r')
for line in MAP:
exec(str(line))
MAP.close()
#sets up level
level = 1
while level <= 6:
#sets up new level
hasNotWon=True
levelReader(level)
#run game loop
while hasNotWon:
deltaFps = time.time()
canvas.draw()
#runs all game logic per frame
hasNotWon = engine.proccess()
#updates the graphics each frame
Graphics.playerInput(engine.player)
deltaFps-= time.time()
deltaFps *= -1
#print(deltaFps)
if deltaFps<FPS:
time.sleep(FPS-deltaFps)
#if deltaFps!=0:
# print(int(1/deltaFps))
level+=1
canvas.reset()
engine.reset()
#shuts down window after game is finished
Graphics.terminate()