dofile('data/Scenes/31_cave_Anim_light.lua')

local PATH_COMICS_31_ON_SHOWN          = 'data/Scenes/Comics/HelpersComicsOneSMS.lua'
local PATH_COMICS_31_TAKE_BULB         = 'data/Scenes/Comics/HelpersComicsReplic.lua'
local PATH_COMICS_31_MIRROR            = 'data/Scenes/Comics/HelpersComicsReplic.lua'
local PATH_COMICS_31_CRYSTAL           = 'data/Scenes/Comics/HelpersComicsReplic.lua'
local PATH_COMICS_31_DARK              = 'data/Scenes/Comics/HelpersComicsReplic.lua'

function OnSceneLoad(screen)
    LoadData(screen)
    DefaultOnSceneLoad(screen:GetName())

    local pf = play_field
    local level = pf:GetLevelScreen()
    
    game_state.size_bulb = 0
    ---------------------------------------------------------------------------------------------
    AddRandomTasks(14,
         CreateTask('CROSSBOW', 'CROSSBOWS', 'arbalest', 'arbalest_2'),
         CreateTask('BUTTERFLY', '', 'butterfly'),
         CreateTask('CAT', '', 'cat'),
         CreateTask('DRAGON', '', 'dragon'),
         CreateTask('FLAMINGO', '', 'flamingo'),
         CreateTask('FLOWER', '', 'flower'),
         CreateTask('FLY', 'FLIES', 'fly', 'fly_2'),
         CreateTask('FORKED', '', 'forked'),
         CreateTask('GLASSES', '', 'glasses'),
         CreateTask('GUITAR', '', 'guitar'),
         CreateTask('SHACKLES', '', 'handcuffs'),
         CreateTask('HORSE', 'HORSES', 'horse', 'horse_2', 'horse_3'),
         CreateTask('KEY', 'KEYS', 'key', 'key_3', 'key_4'),
         CreateTask('KNIFE', '', 'knife'),
         CreateTask('KNIGHT', '', 'knight'),
         CreateTask('MANDOLIN', '', 'mandolin'),
         CreateTask('MOON', 'MOONS', 'moon', 'moon_2'),
         CreateTask('NIGHT_BAT', '', 'night_bat'),
         CreateTask('RIFLE', '', 'rifle'),
         CreateTask('ROPE', 'ROPES', 'rope', 'rope_2'),
         CreateTask('SAW_BLADE', '', 'saw'),
         CreateTask('SUN_CLOCK', '', 'sun_clock'),
         CreateTask('TRUMPET', '', 'trumpet'),
         CreateTask('UMBRELLA', '', 'umbrella'),
         CreateTask('VIOLIN', '', 'violin'),
         CreateTask('WATCH', 'WATCHES', 'watch', 'watch_2')
    )
    pf:IgnoreOnTestPoint('layer_rope_2')
    pf:IgnoreOnTestPoint('cave_dark')
    pf:IgnoreOnTestPoint('layer_gate_close')
    pf:IgnoreOnTestPoint('layer_gate_open')
    pf:IgnoreOnTestPoint('ray_01')
    pf:IgnoreOnTestPoint('ray_02')
    pf:IgnoreOnTestPoint('ray_03')
    ---------------------------------------------------------------------------------------------
    local zone_bag = CreateZoomZone('close_zone_bag',
                                    'pixel_open_bag',
                                    'ZoomBag',
                                    'anim_air',
                                    'anim_water',
                                    'layer_bag'
                                    )
    ---------------------------------------------------------------------------------------------
    pf:GetObject('layer_gate_open'):SetOpacity(0)
    local zone_cave = CreateZoomZone('close_zone_cave',
                                     'pixel_open_cave',
                                     'ZoomCave',
                                     'ZoomCave_Dark',
                                     'rays_in_cave',
                                     'crystal_in_cave',
                                     'pixel_use_crystal'
                                    )
    pf:GetObject('rays_in_cave'):SetMaxOpacity(0)
    pf:GetObject('crystal_in_cave'):SetMaxOpacity(0)
    pf:GetObject('pixel_use_crystal'):SetMaxOpacity(0)
    ---------------------------------------------------------------------------------------------
    local photo_action_bulb = function(save)
                                game_state.size_bulb = game_state.size_bulb + 1
                                if not save then
                                    if game_state.size_bulb == 2 then
                                        game_state.chain_take_bulb.Play()
                                    end
                                end
                              end
    local photo_air     = CreatePhotoZone('anim_air', 'BULB_AIR', 'photo_bulb_air', photo_action_bulb, nil, nil)
    local photo_water   = CreatePhotoZone('anim_water', 'BULB_WATER', 'photo_bulb_water', photo_action_bulb, nil, nil)
    ---------------------------------------------------------------------------------------------
    pf:GetObject('mirror'):SetOpacity(0)
    pf:GetObject('ray_01'):SetOpacity(0)
    pf:GetObject('ray_02'):SetOpacity(0)
    pf:GetObject('ray_03'):SetOpacity(0)
    apply_action_mirror = function(save)
                            if save then
                                pf:GetObject('mirror'):SetOpacity(1)
                                pf:GetObject('ray_01'):SetOpacity(1)
                                pf:GetObject('ray_03'):SetOpacity(1)
                                pf:GetObject('ray_02'):SetOpacity(1)
                                pf:GetObject('cave_dark'):SetOpacity(0)
                            else
                                local time_mirror = 0.3
                                local time_ray = 0.4
                                pf:GetObject('mirror'):ChangeOpacity(0, 1, time_mirror)
                                TimerDo(pf:GetTimer(), time_mirror, function()
                                                                        pf:GetObject('ray_01'):ChangeOpacity(0, 1, time_ray)
                                                                        pf:GetObject('ray_03'):ChangeOpacity(0, 1, time_ray + time_ray)
                                                                        pf:GetObject('ray_02'):ChangeOpacity(0, 1, time_ray + time_ray + time_ray)
                                                                        pf:GetObject('cave_dark'):ChangeOpacity(1, 0, time_ray + time_ray + time_ray)
                                                                     end)
                            end
                            UnregisterActiveObject('ZoomCave_Dark')
                            pf:GetObject('rays_in_cave'):SetMaxOpacity(1)
                            pf:GetObject('pixel_use_crystal'):SetMaxOpacity(0.01)
                            pf:GetObject('ZoomCave_Dark'):SetMaxOpacity(0)
                          end 
    local photo_mirror   = CreatePhotoZoneEx('mirror_in_water', 'mirror_tool', 
                                             'BLUE_MIRROR', 
                                             'photo_mirror', nil, 
                                             'pixel_use_mirror',
                                             apply_action_mirror)
    ---------------------------------------------------------------------------------------------
    apply_action_crystal = function(save)
                             if save then
                                pf:GetObject('layer_gate_open'):SetOpacity(1)
                                pf:GetObject('layer_gate_close'):SetOpacity(0)
                             else
                                local time_crytal = 0.3
                                zone_cave.ChangeObjOpacity('crystal_in_cave', 0, 1, time_crytal)
                                TimerDo(pf:GetTimer(), time_crytal, function()
                                                                        DisableZoomZoneRequest(zone_cave)
                                                                        pf:GetObject('layer_gate_open'):ChangeOpacity(0, 1, 0.3)
                                                                        pf:GetObject('layer_gate_close'):ChangeOpacity(1, 0, 0.3)
                                                                        TimerDo(pf:GetTimer(), 2, function() OnWin() end )
                                                                    end)
                                                                    
                                MakeSoundEntity('31_input_crystal'):Play(false)
                             end
                           end
    local photo_crystal   = CreatePhotoZone('crystal',
                                            'CRYSTAL', 
                                            'photo_crystal', nil, 
                                            'pixel_use_crystal',
                                            apply_action_crystal)
    ---------------------------------------------------------------------------------------------
    local clickOnDark = function(save)
        if not save then
            game_state.chain_dark.Play()
        end
    end
    RegisterActiveObject('ZoomCave_Dark', clickOnDark, true, GetCursorArms())
    ---------------------------------------------------------------------------------------------
    game_state.chain_on_shown = RegisterComicsEx(function()
                                                    LoadComicsWithOneSMS(PATH_COMICS_31_ON_SHOWN, 'COMICS_31_ON_SHOWN')
                                                 end )
    game_state.chain_take_bulb = RegisterComicsEx(function()
	                                                LoadComicsWithOneReplicHeroes(PATH_COMICS_31_TAKE_BULB, 'COMICS_31_TAKE_BULB')
	                                             end )
    game_state.chain_take_bulb.OnHidden = function()
        NotesFound('Notes_16')
    end
    game_state.chain_dark = RegisterComicsEx(function()
	                                                LoadComicsWithOneReplicHeroes(PATH_COMICS_31_DARK, 'COMICS_31_DARK')
	                                             end )
    game_state.chain_dark.SetRepeat(true)
    game_state.chain_mirror = RegisterComicsEx(function()
	                                                LoadComicsWithOneReplicHeroes(PATH_COMICS_31_MIRROR, 'COMICS_31_MIRROR')
	                                          end )
    SetHintComicsPhotoZoneEx(photo_mirror, game_state.chain_mirror)
    game_state.chain_crystal = RegisterComicsEx(function()
	                                                LoadComicsWithOneReplicHeroes(PATH_COMICS_31_CRYSTAL, 'COMICS_31_CRYSTAL')
	                                          end )
    SetHintComicsPhotoZoneEx(photo_crystal, game_state.chain_crystal)
    ---------------------------------------------------------------------------------------------
--[[
    local anim_light = createCompositioncave1soll()
    anim_light:AttachTo(screen)
    anim_light:SetZ(86)
    anim_light:SetCyclic(true)
    anim_light:Play()
]]
    ---------------------------------------------------------------------------------------------
end

function OnSceneFree()
    FreeData()
end

function OnScreenShown(fade_out)
    if fade_out then
        game_state.chain_on_shown.Play()    
        OnWin()
    end
end

function OnHiddenComics()
end

function OnMinigameCompleted(mini_game)
end

function OnUpdate(dt)
    DefaultOnUpdate(dt)
end

function OnLose()
end

function OnExit()
end

function OnButtonMouseEnter(title)
end

function OnButtonMouseLeave(title)
end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end

function OnObjectMouseDown(object)
    obj_name = object:GetName()
    local pf = play_field
    local is_wrong_click = true

    is_wrong_click = DefaultOnObjectMouseDown(object)
    
    return is_wrong_click
end

function OnObjectMouseUp(object)
end

function OnObjectRightMouseDown(object)
end

function OnObjectRightMouseUp(object)
end

function OnObjectFound(object)
    DefaultOnObjectFound(object)
end

function OnToolFound(tool)
end

function OnToolApply(tool, object)
    DefaultOnToolApply(tool, object)
end

function OnObjectReachPanel(object)
    DefaultOnObjectReachPanel(object)
end

function OnPhotographing()
	DefaultOnPhotographing()
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
end

function OnMouseMove(previous_pos, current_pos)
end

function OnSetTool(tool)
end

function OnLostFocus()
end

function OnGainFocus()
end

function OnWin()
    if  play_field:GetLevelScreen():IsCompleteLevel() and
        play_field:GetObject('layer_gate_open'):GetOpacity() == 1
    then
        OnWinLevel()
    end
end

-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function LoadData(screen)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/layers/bg.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bg',anim,512,384,70,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/arbalest.png',0,0,128,71,1,0)
	anim:SetHotSpot(64,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('arbalest',anim,265,642,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/arbalest_2.png',0,0,69,73,1,0)
	anim:SetHotSpot(34,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('arbalest_2',anim,881,486,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/butterfly.png',0,0,44,38,1,0)
	anim:SetHotSpot(22,19)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('butterfly',anim,964,73,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/cat.png',0,0,69,66,1,0)
	anim:SetHotSpot(34,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cat',anim,413,699,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/dragon.png',0,0,67,92,1,0)
	anim:SetHotSpot(33,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('dragon',anim,738,117,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/flamingo.png',0,0,59,92,1,0)
	anim:SetHotSpot(29,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('flamingo',anim,275,132,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/flower.png',0,0,38,90,1,0)
	anim:SetHotSpot(19,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('flower',anim,336,729,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/fly.png',0,0,40,61,1,0)
	anim:SetHotSpot(20,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fly',anim,302,286,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/fly_2.png',0,0,67,51,1,0)
	anim:SetHotSpot(33,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fly_2',anim,733,27,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/forked.png',0,0,58,39,1,0)
	anim:SetHotSpot(29,19)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('forked',anim,526,719,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/glasses.png',0,0,65,35,1,0)
	anim:SetHotSpot(32,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('glasses',anim,243,747,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/guitar.png',0,0,38,86,1,0)
	anim:SetHotSpot(19,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('guitar',anim,454,339,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/handcuffs.png',0,0,63,67,1,0)
	anim:SetHotSpot(31,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('handcuffs',anim,968,718,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/horse.png',0,0,60,63,1,0)
	anim:SetHotSpot(30,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('horse',anim,303,58,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/horse_2.png',0,0,54,73,1,0)
	anim:SetHotSpot(27,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('horse_2',anim,258,321,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/horse_3.png',0,0,59,52,1,0)
	anim:SetHotSpot(29,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('horse_3',anim,283,238,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/key.png',0,0,26,52,1,0)
	anim:SetHotSpot(13,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('key',anim,534,38,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/key_3.png',0,0,39,27,1,0)
	anim:SetHotSpot(19,13)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('key_3',anim,240,614,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/key_4.png',0,0,37,57,1,0)
	anim:SetHotSpot(18,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('key_4',anim,989,315,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/knife.png',0,0,58,71,1,0)
	anim:SetHotSpot(29,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('knife',anim,653,613,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/knight.png',0,0,43,107,1,0)
	anim:SetHotSpot(21,53)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('knight',anim,740,268,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/mandolin.png',0,0,42,69,1,0)
	anim:SetHotSpot(21,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('mandolin',anim,911,448,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/moon.png',0,0,43,51,1,0)
	anim:SetHotSpot(21,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('moon',anim,336,23,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/moon_2.png',0,0,44,56,1,0)
	anim:SetHotSpot(22,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('moon_2',anim,794,51,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/night_bat.png',0,0,150,67,1,0)
	anim:SetHotSpot(75,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('night_bat',anim,633,30,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/rifle.png',0,0,101,116,1,0)
	anim:SetHotSpot(50,58)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('rifle',anim,253,555,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/rope.png',0,0,81,45,1,0)
	anim:SetHotSpot(40,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('rope',anim,756,741,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/rope_2.png',0,0,47,68,1,0)
	anim:SetHotSpot(23,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('rope_2',anim,951,416,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/saw.png',0,0,42,42,1,0)
	anim:SetHotSpot(21,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('saw',anim,227,691,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/sun_clock.png',0,0,53,46,1,0)
	anim:SetHotSpot(26,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sun_clock',anim,436,491,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/trumpet.png',0,0,58,61,1,0)
	anim:SetHotSpot(29,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('trumpet',anim,754,639,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/umbrella.png',0,0,30,147,1,0)
	anim:SetHotSpot(15,73)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('umbrella',anim,822,436,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/violin.png',0,0,84,62,1,0)
	anim:SetHotSpot(42,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('violin',anim,905,353,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/watch.png',0,0,32,41,1,0)
	anim:SetHotSpot(16,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('watch',anim,608,136,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/watch_2.png',0,0,52,78,1,0)
	anim:SetHotSpot(26,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('watch_2',anim,282,392,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/layers/layer_knife.png',0,0,29,26,1,0)
	anim:SetHotSpot(14,13)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_knife',anim,676,642,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/layers/layer_rope_2.png',0,0,46,58,1,0)
	anim:SetHotSpot(23,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_rope_2',anim,952,406,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/layers/layer_saw.png',0,0,46,41,1,0)
	anim:SetHotSpot(23,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_saw',anim,238,710,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/zoom_bag/ZoomBag.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ZoomBag',anim,512,384,700,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('pixel_open_bag',anim,272,469,100,0,9,9)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/photo/photo_bulb_air.jpg',0,0,177,298,1,0)
	anim:SetHotSpot(88,149)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('photo_bulb_air',anim,85,703,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/photo/photo_bulb_water.jpg',0,0,177,298,1,0)
	anim:SetHotSpot(88,149)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('photo_bulb_water',anim,81,708,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/layers/layer_gate_close.png',0,0,233,219,1,0)
	anim:SetHotSpot(116,109)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_gate_close',anim,619,320,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/layers/layer_gate_open.png',0,0,237,217,1,0)
	anim:SetHotSpot(118,108)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_gate_open',anim,607,321,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/zoom_bag/layers/layer_bag.png',0,0,241,126,1,0)
	anim:SetHotSpot(120,63)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_bag',anim,401,539,740,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/mirror.png',0,0,93,133,1,0)
	anim:SetHotSpot(46,66)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('mirror',anim,367,371,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/mirror_in_water.png',0,0,113,74,1,0)
	anim:SetHotSpot(56,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('mirror_in_water',anim,418,619,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/photo/photo_mirror.jpg',0,0,177,298,1,0)
	anim:SetHotSpot(88,149)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('photo_mirror',anim,3,812,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/mirror_tool.png',0,0,113,74,1,0)
	anim:SetHotSpot(56,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('mirror_tool',anim,34,541,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('pixel_use_mirror',anim,369,370,110,0,12,17)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/layers/ray_01.png',0,0,850,489,1,0)
	anim:SetHotSpot(425,244)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ray_01',anim,629,319,130,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/layers/ray_02.png',0,0,1052,798,1,0)
	anim:SetHotSpot(526,399)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ray_02',anim,603,361,130,14,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/layers/ray_03.png',0,0,1024,554,1,0)
	anim:SetHotSpot(512,277)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ray_03',anim,514,274,130,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('pixel_open_cave',anim,604,289,155,0,24,16)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/zoom_cave/ZoomCave.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('ZoomCave',anim,512,384,900,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/photo/photo_crystal.jpg',0,0,177,298,1,0)
	anim:SetHotSpot(88,149)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('photo_crystal',anim,48,765,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/items/crystal.png',0,0,36,47,1,0)
	anim:SetHotSpot(18,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('crystal',anim,667,117,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/zoom_cave/rays_in_cave.png',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('rays_in_cave',anim,511,384,990,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/zoom_cave/crystal_in_cave.png',0,0,44,50,1,0)
	anim:SetHotSpot(22,25)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('crystal_in_cave',anim,526,402,950,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pixel_use_crystal',anim,524,400,9700,0,10,10)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/zoom_cave/ZoomCave_Dark.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('ZoomCave_Dark',anim,512,384,905,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/31_cave_/layers/cave_dark.png',0,0,392,324,1,0)
	anim:SetHotSpot(196,162)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cave_dark',anim,630,248,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Animations/anim_bulb/anim_water.png',0,0,68,99,54,12)
	anim:SetHotSpot(34,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('anim_water',anim,425,497,720,0,0.98,1)
	local anim = CreateAnimation('data/Texture/Animations/anim_bulb/anim_air.png',0,0,88,98,54,12)
	anim:SetHotSpot(44,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('anim_air',anim,342,536,720,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
