
local PATH_COMICS_30_ON_SHOWN               = 'data/Scenes/Comics/HelpersComicsOneSMS.lua'
local PATH_COMICS_30_ON_WIN                 = 'data/Scenes/Comics/HelpersComicsOneSMS.lua'
local PATH_COMICS_30_WHEEL                  = 'data/Scenes/Comics/HelpersComicsReplic.lua'
local PATH_COMICS_30_ROPE                   = 'data/Scenes/Comics/HelpersComicsReplic.lua'
local PATH_COMICS_30_CREATE_BATTERING_RAM   = 'data/Scenes/Comics/HelpersComicsReplic.lua'
local PATH_COMICS_30_COIN                   = 'data/Scenes/Comics/HelpersComicsReplic.lua'

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

    local pf = play_field
    local level = pf:GetLevelScreen()
	---------------------------------------------------------------------------------------------
	level:AddTaskSafe(CreateTask('COIN', '', 'coin'))
	AddRandomTasks(13,
         CreateTask('BOOMERANG', '', 'boomerang'),
         CreateTask('BUG', 'BUGS', 'bug', 'bug_2', 'bug_3'),
         CreateTask('DRAGONFLY', 'DRAGONFLIES', 'dragonfly', 'dragonfly_2', 'dragonfly_3'),
         CreateTask('FAN', 'FANS', 'fan', 'fan_2'),
         CreateTask('FISH', 'FISH', 'fish', 'fish_2', 'fish_3'),
         CreateTask('PAW_PRINT', '', 'footprint'),
         CreateTask('HAMMER', 'HAMMERS', 'hammer', 'hammer_2', 'hammer_3'),
         CreateTask('JUG', 'JUGS', 'jug_2', 'jug_3'),
         CreateTask('TEAPOT', '', 'jug'),
         CreateTask('LIZARD', 'LIZARDS', 'lizard', 'lizard_2', 'lizard_3'),
         CreateTask('MASK', 'MASKS', 'mask', 'mask_2', 'mask_3'),
         CreateTask('PEPPER', 'PEPPERS', 'pepper', 'pepper_2', 'pepper_3'),
         CreateTask('SEA_HORSE', '', 'sea_horse'),
         CreateTask('SKULL', 'SKULLS', 'skull', 'skull_2', 'skull_3'),
         CreateTask('SNAIL', '', 'snail'),
         CreateTask('SPHINX', '', 'sphinx'),
         CreateTask('STAR', 'STARS', 'star', 'star_2', 'star_3'),
         
         CreateTask('BELL', '', 'bell'),
         CreateTask('BERRIES', '', 'berry'),
         CreateTask('BEADS', '', 'rosary'),
         CreateTask('SNAKE', '', 'snake'),
         
         CreateTask('BRACELET', '', 'bracelet'),
         CreateTask('DAGGER', '', 'dagger'),
         CreateTask('PIGEON', '', 'pigeon'),
         CreateTask('SCORPION', '', 'scorpion'),
         CreateTask('TURTLE', '', 'turtle')
    )
    pf:IgnoreOnTestPoint('layer_jug_3')
    pf:IgnoreOnTestPoint('layer_fan')
    pf:IgnoreOnTestPoint('layer_fan_2')
    pf:IgnoreOnTestPoint('layer_boomerang')
    ---------------------------------------------------------------------------------------------
    pf:IgnoreOnTestPoint('br_without_rope_wheel')
    pf:IgnoreOnTestPoint('br_without_wheel')
    pf:IgnoreOnTestPoint('br_wheel')
    pf:GetObject('br_without_rope_wheel'):SetOpacity(1)
    pf:GetObject('br_without_wheel'):SetOpacity(0)
    pf:GetObject('br_wheel'):SetOpacity(0)
    pf:GetObject('br_without_rope_wheel'):GetAnimation():SetColor('0xFFFFFFFF')
    pf:GetObject('br_without_wheel'):GetAnimation():SetColor('0xFFFFFFFF')
    pf:GetObject('br_wheel'):GetAnimation():SetColor('0xFFFFFFFF')
    
    pf:GetObject('battering_ram'):SetOpacity(0)
    pf:GetObject('battering_ram_run'):SetOpacity(0)
    pf:GetObject('battering_ram_run'):GetAnimation():SetMode(HGEANIM_FWD + HGEANIM_NOLOOP)
    pf:GetObject('battering_ram_run'):GetAnimation():Stop()
    pf:IgnoreOnTestPoint('battering_ram_run')
    ---------------------------------------------------------------------------------------------
    local zone_rope = CreateZoomZone('close_zone_rope',
                                     '', -- pixel_open_rope
                                     'bg_zoom_rope',
                                     'rope',
                                     'layer_rope',
                                     'bell',
                                     'berry',
                                     'rosary',
                                     'snake',
                                     'layer_rosary',
                                     'layer_snake'
                                    )
    pf:IgnoreOnTestPoint('layer_rosary')
    pf:IgnoreOnTestPoint('layer_snake')
    ---------------------------------------------------------------------------------------------
    local zone_wheel = CreateZoomZone('close_zone_wheel',
                                      'pixel_open_wheel',
                                      'bg_zoom_wheel',
                                      'wheel',
                                      'feather',
                                      'spoon',
                                      'layer_spoon'
                                     )
    pf:IgnoreOnTestPoint('layer_spoon')
    ---------------------------------------------------------------------------------------------
    local zone_coin = CreateZoomZone('close_zone_coin',
                                     'pixel_open_coin',
                                     'bg_zoom_coin',
                                     'coin',
                                     'bracelet',
                                     'dagger',
                                     'pigeon',
                                     'scorpion',
                                     'turtle'
                                    )
    ---------------------------------------------------------------------------------------------
    local apply_action_rope = function(save)
        if save then
            pf:GetObject('br_without_wheel'):SetOpacity(1)
            pf:GetObject('br_without_rope_wheel'):SetOpacity(0)
            CheckReadingBatteringRam(true)
        else
            pf:GetObject('br_without_wheel'):ChangeOpacity(0, 1, 0.3)
            pf:GetObject('br_without_rope_wheel'):ChangeOpacity(1, 0, 0.3)
            
            TimerDo(pf:GetTimer(), 0.4, function() CheckReadingBatteringRam(false) end)
            MakeSoundEntity('30_use_rope'):Play(false)
        end

        pf:GetObject('pixel_use_rope'):SetOpacity(0)
    end
    local photo_rope = CreatePhotoZoneEx('rope', 'rope_tool',
									   'ROPE_COIL',
                                       'photo_rope',
                                       nil,
                                       'pixel_use_rope',
                                       apply_action_rope)
    ---------------------------------------------------------------------------------------------
    local apply_action_wheel = function(save)
        if save then
            pf:GetObject('br_wheel'):SetOpacity(1)
            CheckReadingBatteringRam(true)
        else
            pf:GetObject('br_wheel'):ChangeOpacity(0, 1, 0.3)
            
            TimerDo(pf:GetTimer(), 0.4, function() CheckReadingBatteringRam(false) end)
            MakeSoundEntity('30_insert_wheel'):Play(false)
        end            
    end
    local photo_wheel = CreatePhotoZoneEx('wheel', 'wheel_tool',
									   'WHEEL',
                                       'photo_wheel',
                                        nil,
                                        'pixel_use_wheel',
                                        apply_action_wheel)
    ---------------------------------------------------------------------------------------------
    local clickOnWall = function(save)
        if save then
            pf:GetObject('layer_wall'):SetOpacity(0)
            RegisterZoomZone(zone_rope, 'pixel_open_rope')
        else
            local time = 0.3
            pf:GetObject('layer_wall'):ChangeOpacity(1, 0, time)
            TimerDo(pf:GetTimer(), time, function()
                                            RegisterZoomZone(zone_rope, 'pixel_open_rope')
                                         end )
                                         
            MakeSoundEntity('30_break_off_wall'):Play(false)
        end
    end
    RegisterActiveObject('layer_wall', clickOnWall, false, GetCursorArms())
    ---------------------------------------------------------------------------------------------
    pf:GetObject('door_break'):SetOpacity(0)
    local clickOnBatteringRam = function(save)
        if save then
            pf:GetObject('door_entire'):SetOpacity(0)
            pf:GetObject('door_break'):SetOpacity(1)
            
            OnWin()
        else
            local anim_battering_ram_run = pf:GetObject('battering_ram_run'):GetAnimation()
            local length_anim = GetAnimationLength(anim_battering_ram_run)
        
            anim_battering_ram_run:Play()
            TimerDo(pf:GetTimer(), 1.1, function()
                                            local time = 0.2
                                            pf:GetObject('door_entire'):ChangeOpacity(1, 0, time)
                                            pf:GetObject('door_break'):ChangeOpacity(0, 1, time)
                                            
                                            pf:GetObject('pixel_kick'):AddParticleSystem('data/ParticleSystem/battering_ram_run.psi', pf:GetObject('kick_particle'):GetAnimationPtr() )
                                        end)
            TimerDo(pf:GetTimer(), length_anim, function() OnWin() end)
            
            MakeSoundEntity('30_use_ram'):Play(false)
        end
    end
    RegisterActiveObject('battering_ram', clickOnBatteringRam, false, GetCursorArms())
    ---------------------------------------------------------------------------------------------
    game_state.chain_on_shown = RegisterComicsEx(function()
	                                                LoadComicsWithOneSMS(PATH_COMICS_30_ON_SHOWN, 'COMICS_30_ON_SHOWN')
	                                             end )
    game_state.chain_on_win = RegisterComicsEx(function()
	                                                LoadComicsWithOneSMS(PATH_COMICS_30_ON_WIN, 'COMICS_30_ON_WIN')
	                                             end )
    game_state.chain_on_win.OnHidden = function()
        OnWinLevel()
    end
    
    game_state.chain_wheel = RegisterComicsEx(function()
	                                            LoadComicsWithOneReplicHeroes(PATH_COMICS_30_WHEEL, 'COMICS_30_WHEEL')
	                                          end )
    SetHintComicsPhotoZoneEx(photo_wheel, game_state.chain_wheel)
    
    game_state.chain_rope = RegisterComicsEx(function()
	                                            LoadComicsWithOneReplicHeroes(PATH_COMICS_30_ROPE, 'COMICS_30_ROPE')
	                                          end )
    SetHintComicsPhotoZoneEx(photo_rope, game_state.chain_rope)
    
    game_state.chain_create_battering_ram = RegisterComicsEx(function()
	                                            LoadComicsWithOneReplicHeroes(PATH_COMICS_30_CREATE_BATTERING_RAM, 'COMICS_30_CREATE_BATTERING_RAM')
	                                          end )
    game_state.chain_coin = RegisterComicsEx(function()
	                                            LoadComicsWithOneReplicHeroes(PATH_COMICS_30_COIN, 'COMICS_30_COIN')
	                                          end )
    ---------------------------------------------------------------------------------------------
end

function CheckReadingBatteringRam(save)
    local pf = play_field

    if  pf:GetObject('br_wheel'):GetOpacity() == 1 and 
        pf:GetObject('br_without_wheel'):GetOpacity() == 1
    then
        if save then
            pf:GetObject('br_wheel'):SetOpacity(0)
            pf:GetObject('br_without_wheel'):SetOpacity(0)
            pf:GetObject('battering_ram'):SetOpacity(1)
            pf:GetObject('battering_ram_run'):SetOpacity(1)
        else
            pf:GetObject('br_wheel'):ChangeOpacity(1, 0, 0.1)
            pf:GetObject('br_without_wheel'):ChangeOpacity(1, 0, 0.1)
            pf:GetObject('battering_ram'):ChangeOpacity(0, 1, 0.1)
            pf:GetObject('battering_ram_run'):ChangeOpacity(0, 1, 0.1)
            
            game_state.chain_create_battering_ram.Play()
        end
    end
end

function OnSceneFree()
    FreeData()
end

function OnScreenShown(fade_out)
    if fade_out then
        game_state.chain_on_shown.Play()
    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)
    
    if object:GetName() == 'coin' then
        game_state.chain_coin:Play()
    end
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('door_break'):GetOpacity() == 1
    then
        game_state.chain_on_win.Play()
    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/30_entrance_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/30_entrance_cave_/items/boomerang.png',0,0,120,79,1,0)
	anim:SetHotSpot(60,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('boomerang',anim,832,241,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/bug.png',0,0,52,52,1,0)
	anim:SetHotSpot(26,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bug',anim,707,683,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/bug_2.png',0,0,43,33,1,0)
	anim:SetHotSpot(21,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bug_2',anim,340,690,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/bug_3.png',0,0,42,40,1,0)
	anim:SetHotSpot(21,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bug_3',anim,988,358,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/dragonfly.png',0,0,49,50,1,0)
	anim:SetHotSpot(24,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('dragonfly',anim,227,473,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/dragonfly_2.png',0,0,50,43,1,0)
	anim:SetHotSpot(25,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('dragonfly_2',anim,742,144,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/dragonfly_3.png',0,0,65,59,1,0)
	anim:SetHotSpot(32,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('dragonfly_3',anim,364,110,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/fan.png',0,0,107,57,1,0)
	anim:SetHotSpot(53,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fan',anim,883,742,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/fan_2.png',0,0,84,59,1,0)
	anim:SetHotSpot(42,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fan_2',anim,807,297,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/fish.png',0,0,89,64,1,0)
	anim:SetHotSpot(44,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fish',anim,522,56,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/fish_2.png',0,0,39,73,1,0)
	anim:SetHotSpot(19,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fish_2',anim,697,290,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/fish_3.png',0,0,94,78,1,0)
	anim:SetHotSpot(47,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fish_3',anim,257,37,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/footprint.png',0,0,34,34,1,0)
	anim:SetHotSpot(17,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('footprint',anim,218,647,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/hammer.png',0,0,96,48,1,0)
	anim:SetHotSpot(48,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hammer',anim,907,330,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/hammer_2.png',0,0,61,82,1,0)
	anim:SetHotSpot(30,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hammer_2',anim,313,195,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/hammer_3.png',0,0,43,108,1,0)
	anim:SetHotSpot(21,54)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hammer_3',anim,241,370,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/jug.png',0,0,77,79,1,0)
	anim:SetHotSpot(38,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('jug',anim,572,203,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/jug_2.png',0,0,57,90,1,0)
	anim:SetHotSpot(28,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('jug_2',anim,984,279,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/jug_3.png',0,0,86,86,1,0)
	anim:SetHotSpot(43,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('jug_3',anim,974,689,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/lizard.png',0,0,63,65,1,0)
	anim:SetHotSpot(31,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('lizard',anim,387,210,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/lizard_2.png',0,0,84,51,1,0)
	anim:SetHotSpot(42,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('lizard_2',anim,952,373,140,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/lizard_3.png',0,0,51,74,1,0)
	anim:SetHotSpot(25,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('lizard_3',anim,660,219,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/mask.png',0,0,61,61,1,0)
	anim:SetHotSpot(30,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('mask',anim,252,132,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/mask_2.png',0,0,59,69,1,0)
	anim:SetHotSpot(29,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('mask_2',anim,600,289,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/mask_3.png',0,0,135,61,1,0)
	anim:SetHotSpot(67,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('mask_3',anim,410,731,350,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/pepper.png',0,0,55,28,1,0)
	anim:SetHotSpot(27,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pepper',anim,503,242,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/pepper_2.png',0,0,33,50,1,0)
	anim:SetHotSpot(16,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pepper_2',anim,969,459,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/pepper_3.png',0,0,82,36,1,0)
	anim:SetHotSpot(41,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pepper_3',anim,331,645,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/sea_horse.png',0,0,42,54,1,0)
	anim:SetHotSpot(21,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sea_horse',anim,322,24,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/skull.png',0,0,115,58,1,0)
	anim:SetHotSpot(57,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('skull',anim,957,572,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/skull_2.png',0,0,102,82,1,0)
	anim:SetHotSpot(51,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('skull_2',anim,254,283,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/skull_3.png',0,0,62,92,1,0)
	anim:SetHotSpot(31,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('skull_3',anim,238,556,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/snail.png',0,0,39,48,1,0)
	anim:SetHotSpot(19,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('snail',anim,1004,627,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/sphinx.png',0,0,59,78,1,0)
	anim:SetHotSpot(29,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sphinx',anim,420,288,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/star.png',0,0,49,48,1,0)
	anim:SetHotSpot(24,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('star',anim,330,271,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/star_2.png',0,0,51,48,1,0)
	anim:SetHotSpot(25,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('star_2',anim,711,35,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/items/star_3.png',0,0,25,25,1,0)
	anim:SetHotSpot(12,12)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('star_3',anim,873,459,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/layer_boomerang.png',0,0,103,90,1,0)
	anim:SetHotSpot(51,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_boomerang',anim,835,240,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/layer_skull.png',0,0,112,45,1,0)
	anim:SetHotSpot(56,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_skull',anim,962,592,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/layer_jug_3.png',0,0,91,91,1,0)
	anim:SetHotSpot(45,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_jug_3',anim,975,689,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/layer_fan.png',0,0,149,66,1,0)
	anim:SetHotSpot(74,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_fan',anim,902,736,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/layer_fan_2.png',0,0,93,62,1,0)
	anim:SetHotSpot(46,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_fan_2',anim,807,290,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/layer_hammer.png',0,0,90,27,1,0)
	anim:SetHotSpot(45,13)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_hammer',anim,912,346,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_rope/layers/bg_zoom_rope.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('bg_zoom_rope',anim,512,384,500,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_rope/items/rope.png',0,0,408,276,1,0)
	anim:SetHotSpot(204,138)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('rope',anim,629,485,520,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_rope/layers/layer_rope.png',0,0,485,154,1,0)
	anim:SetHotSpot(242,77)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('layer_rope',anim,538,548,540,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_rope',anim,926,235,180,0,9,16)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_wheel/layers/bg_zoom_wheel.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('bg_zoom_wheel',anim,512,384,700,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_wheel/items/wheel.png',0,0,391,215,1,0)
	anim:SetHotSpot(195,107)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('wheel',anim,590,373,720,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_wheel',anim,833,543,150,0,15,7)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/photo/photo_rope.jpg',0,0,177,298,1,0)
	anim:SetHotSpot(88,149)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('photo_rope',anim,99,871,10,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/photo/photo_wheel.jpg',0,0,177,298,1,0)
	anim:SetHotSpot(88,149)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('photo_wheel',anim,98,882,10,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/layer_wall.png',0,0,127,168,1,0)
	anim:SetHotSpot(63,84)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_wall',anim,932,230,200,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/battering_ram/br_without_rope_wheel.png',0,0,477,400,1,0)
	anim:SetHotSpot(238,200)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('br_without_rope_wheel',anim,561,567,200,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/battering_ram/br_without_wheel.png',0,0,411,407,1,0)
	anim:SetHotSpot(205,203)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('br_without_wheel',anim,551,562,200,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/battering_ram/br_wheel.png',0,0,58,82,1,0)
	anim:SetHotSpot(29,41)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('br_wheel',anim,587,690,210,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_wheel',anim,589,690,250,0,14,14)
	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_rope',anim,587,470,300,0,20,25)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_rope/items/rope_tool.png',0,0,120,110,1,0)
	anim:SetHotSpot(60,55)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('rope_tool',anim,98,680,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_wheel/items/wheel_tool.png',0,0,60,84,1,0)
	anim:SetHotSpot(30,42)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('wheel_tool',anim,111,681,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_rope/items/bell.png',0,0,43,45,1,0)
	anim:SetHotSpot(21,22)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('bell',anim,258,549,5200,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_rope/items/berry.png',0,0,68,52,1,0)
	anim:SetHotSpot(34,26)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('berry',anim,248,332,520,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_rope/items/rosary.png',0,0,86,131,1,0)
	anim:SetHotSpot(43,65)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('rosary',anim,436,213,520,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_rope/items/snake.png',0,0,141,136,1,0)
	anim:SetHotSpot(70,68)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('snake',anim,440,372,520,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_rope/layers/layer_rosary.png',0,0,90,143,1,0)
	anim:SetHotSpot(45,71)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('layer_rosary',anim,441,208,550,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_rope/layers/layer_snake.png',0,0,148,135,1,0)
	anim:SetHotSpot(74,67)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('layer_snake',anim,438,364,550,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_coin',anim,366,560,100,0,12,7)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_coin/layers/bg_zoom_coin.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('bg_zoom_coin',anim,512,384,900,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_coin/items/coin.png',0,0,63,42,1,0)
	anim:SetHotSpot(31,21)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('coin',anim,561,484,910,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_coin/items/bracelet.png',0,0,61,46,1,0)
	anim:SetHotSpot(30,23)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('bracelet',anim,625,602,910,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_coin/items/dagger.png',0,0,90,169,1,0)
	anim:SetHotSpot(45,84)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('dagger',anim,775,531,910,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_coin/items/pigeon.png',0,0,90,54,1,0)
	anim:SetHotSpot(45,27)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pigeon',anim,604,388,910,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_coin/items/scorpion.png',0,0,45,43,1,0)
	anim:SetHotSpot(22,21)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('scorpion',anim,378,447,910,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_coin/items/turtle.png',0,0,92,49,1,0)
	anim:SetHotSpot(46,24)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('turtle',anim,358,571,910,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_wheel/items/feather.png',0,0,71,68,1,0)
	anim:SetHotSpot(35,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('feather',anim,333,365,710,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_wheel/items/spoon.png',0,0,159,37,1,0)
	anim:SetHotSpot(79,18)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('spoon',anim,383,278,710,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/zoom_wheel/layers/layer_spoon.png',0,0,67,49,1,0)
	anim:SetHotSpot(33,24)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('layer_spoon',anim,328,277,720,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/door_entire.png',0,0,264,242,1,0)
	anim:SetHotSpot(132,121)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('door_entire',anim,610,455,160,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/door_break.png',0,0,359,193,1,0)
	anim:SetHotSpot(179,96)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('door_break',anim,596,549,165,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/layers/battering_ram/battering_ram.png',0,0,308,262,1,0)
	anim:SetHotSpot(154,131)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('battering_ram',anim,565,526,200,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/30_entrance_cave_/animations/battering_ram_run.png',0,0,188,219,11,5)
	anim:SetHotSpot(94,109)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('battering_ram_run',anim,484,509,250,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_kick',anim,574,526,190,0,1,1)
	local anim = CreateAnimation('data/Texture/Effect/particles.png',0,0,32,32,1,0)
	anim:SetHotSpot(16,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('kick_particle',anim,104,588,100,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
