本文整理汇总了Python中GameState.get_camera方法的典型用法代码示例。如果您正苦于以下问题:Python GameState.get_camera方法的具体用法?Python GameState.get_camera怎么用?Python GameState.get_camera使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameState
的用法示例。
在下文中一共展示了GameState.get_camera方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: inspect_tile
# 需要导入模块: import GameState [as 别名]
# 或者: from GameState import get_camera [as 别名]
def inspect_tile(x, y):
global delay, map_old_x, map_old_y, new_animation
if 0 < x < Constants.MAP_CONSOLE_WIDTH and 0 < y < Constants.MAP_CONSOLE_HEIGHT:
# Mouse over Inspection
camera_x, camera_y = GameState.get_camera()
map_x, map_y = (camera_x + x, camera_y + y)
if map_x is map_old_x and map_y is map_old_y:
if time.time() - delay > Constants.INSPECTION_DELAY:
# Post-Delay
if GameState.current_level.map_array[map_x][map_y].explored:
obj = [obj for obj in GameState.current_level.get_all_objects() if obj.x == map_x and obj.y == map_y]
if len(obj) == 0:
pass
else:
# print "animating..."
#TODO: Re-implement Inspection (make a mode, not always on)
#Animate.inspect_banner(x, y, obj[0].name, new_animation)
new_animation = False
else:
# Pre-Delay
pass
else:
# 88Render.clear_animations()
new_animation = True
map_old_x = map_x
map_old_y = map_y
delay = time.time()