當前位置: 首頁>>代碼示例>>Python>>正文


Python GameState.get_camera方法代碼示例

本文整理匯總了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()
開發者ID:joekane,項目名稱:DeepFriedSuperNova,代碼行數:33,代碼來源:Utils.py


注:本文中的GameState.get_camera方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。