function OnSceneLoad(screen)
    LoadData(screen)
    DefaultOnSceneLoad('data/Scenes/05_Metrodotel_Attic_HO.lua',
                       'hidden_object',
                       'data/Scenes/05_Metrodotel_Hall_Main.lua')

   local level = play_field:GetLevelScreen()
    
    level:AddTask(CreateTask('BROOM', '', 'broom'))
    level:AddTask(CreateTask('DUCK', '', 'duck'))
    level:AddTask(CreateTask('IRON', '', 'Iron'))
    level:AddTask(CreateTask('KEY', '', 'Key'))
    level:AddTask(CreateTask('LOCK', 'LOCKS', 'lock', 'Zamok1', 'Zamok2', 'Zamok3'))
    level:AddTask(CreateTask('MASLENKA', '', 'Maslenka'))
    level:AddTask(CreateTask('MITTEN', 'MITTENS', 'Mitten', 'Varezhka1', 'Varezhka2'))
    level:AddTask(CreateTask('PARROT', '', 'Parrot'))
    --level:AddTask(CreateTask('RECORD', '', 'Record'))
    level:AddTask(CreateTask('STATUETTE', '', 'Statuette'))
    level:AddTask(CreateTask('TEDDYBEAR', '', 'TeddyBear'))
    level:AddTask(CreateTask('TELEPHONE', '', 'Telephone'))
	level:AddTask(CreateTask('PARASOL', '', 'Umbrella'))

	play_field:IgnoreOnTestPoint('BG_Varezhka2')

    RegisterToolFindInfo('05_oiler', nil, nil, nil)

    play_field:GetObject('picture_fall'):GetAnimation():Stop();
    play_field:GetObject('picture_fall'):GetAnimation():SetMode(HGEANIM_FWD + HGEANIM_NOLOOP);
    
    RegisterActiveObject('picture_fall',
        function()
            play_field:GetObject('picture_fall'):GetAnimation():Play();
            MakeSoundEntity('PictureFall'):Play(false);
        end,
        function()
            play_field:GetObject('picture_fall'):GetAnimation():Rewind(true)
        end, false)
    --[[
    set_random_frame(play_field:GetObject('candle_22'):GetAnimation())
    set_random_frame(play_field:GetObject('candle_23'):GetAnimation())
    
    local lightEff = MegoLightEffector();
    lightEff:AttachTo(play_field:GetObject('candle_glow_22'));
    lightEff:Play();
    
    local lightEff = MegoLightEffector();
    lightEff:AttachTo(play_field:GetObject('candle_glow_23'));
    lightEff:PlayAt(0.5);
    ]]
    local effector = CreateAnimationEffector();
	effector:SetMode(_ANIM_LOOP); -- loop
	effector:SetKey(_TRACK_O, 0.0, 0.45);
	effector:SetKey(_TRACK_O, 1.4, 1.0);
	effector:SetKey(_TRACK_O, 2.8, 0.45);
	effector:AttachTo(play_field:GetObject('global_light'));
	effector:Play();
	
	LoadSound("PictureFall", "data/Sound/05_Metrodotel_Hall/Picture_fall_brake.ogg");
    
end

function OnSceneFree(screen)
    DefaultOnSceneFree()
    FreeData(screen)
end

function OnUpdate(dt)
    DefaultOnUpdate(dt)
end

function OnAllItemsFound()
    DefaultOnAllItemsFound()
end

function OnLose()
    DefaultOnLose()
end

function OnExit()
    DefaultOnExit()
end

function OnClose()
    DefaultOnClose()
end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end

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

    DefaultOnObjectMouseDownProcessed(is_wrong_click);
end

function OnObjectMouseUp(object)
    DefaultOnObjectMouseUp(object)
end

function OnObjectFound(object)
    DefaultOnObjectFound(object)
end

function OnToolFound(tool)
    DefaultOnToolFound(tool)
end

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

function OnObjectReachPanel(object)
    DefaultOnObjectReachPanel(object)
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
end

function OnMouseMove(previous_pos, current_pos)
    DefaultOnMouseMove(previous_pos, current_pos)
end

function OnSetTool(tool)
    DefaultOnSetTool(tool)
end

function LevelLoaded(level)

end

function OnSceneDestroy(playfield)
    DefaultOnSceneDestroy(playfield)
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/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/broom.png',0,0,100,360,1,0)
	anim:SetHotSpot(50,180)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('broom',anim,111,487,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/duck.png',0,0,57,48,1,0)
	anim:SetHotSpot(28,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('duck',anim,579,433,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/Iron.PNG',0,0,58,68,1,0)
	anim:SetHotSpot(29,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Iron',anim,427,605,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/Key.PNG',0,0,30,72,1,0)
	anim:SetHotSpot(15,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Key',anim,415,206,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/lock.png',0,0,49,67,1,0)
	anim:SetHotSpot(24,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('lock',anim,356,400,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/Maslenka.PNG',0,0,56,64,1,0)
	anim:SetHotSpot(28,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Maslenka',anim,682,565,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/Mitten.PNG',0,0,46,79,1,0)
	anim:SetHotSpot(23,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Mitten',anim,541,185,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/Parrot.PNG',0,0,40,105,1,0)
	anim:SetHotSpot(20,52)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Parrot',anim,726,608,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/Record.PNG',0,0,92,94,1,0)
	anim:SetHotSpot(33,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Record',anim,973,348,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/Statuette.PNG',0,0,56,91,1,0)
	anim:SetHotSpot(28,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Statuette',anim,830,375,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/TeddyBear.PNG',0,0,89,89,1,0)
	anim:SetHotSpot(44,44)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('TeddyBear',anim,788,562,100,0,0.99,0.99)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/Telephone.PNG',0,0,113,152,1,0)
	anim:SetHotSpot(48,62)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Telephone',anim,478,254,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items/Umbrella.PNG',0,0,144,137,1,0)
	anim:SetHotSpot(72,68)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Umbrella',anim,697,37,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Layers/Layer_Bear_over.PNG',0,0,57,43,1,0)
	anim:SetHotSpot(28,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Bear_over',anim,793,583,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Layers/Layer_Iron_Over.PNG',0,0,75,57,1,0)
	anim:SetHotSpot(37,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Iron_Over',anim,426,633,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Layers/BG_cherdak.JPG',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_cherdak',anim,512,384,40,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Tools/maslenka_inv.png',0,0,28,60,1,0)
	anim:SetHotSpot(14,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('maslenka_inv',anim,512,384,1,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Tools/maslenka_window.png',0,0,93,200,1,0)
	anim:SetHotSpot(46,100)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('tool_maslenka_info_icon',anim,512,384,1,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Layers/Light.png',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('global_light',anim,512,384,41,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Layers/Layer_Lock_Over.png',0,0,19,17,1,0)
	anim:SetHotSpot(9,8)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Lock_Over',anim,351,376,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Layers/Layer_curtain.png',0,0,132,184,1,0)
	anim:SetHotSpot(66,92)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_curtain',anim,439,455,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Animations/picture_fall.png',0,0,135,355,17,12)
	anim:SetHotSpot(67,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('picture_fall',anim,428,214,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Layers/Layer_Broom_Over.PNG',0,0,86,78,1,0)
	anim:SetHotSpot(43,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Broom_Over',anim,121,587,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items_add/Varezhka1.png',0,0,46,72,1,0)
	anim:SetHotSpot(23,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Varezhka1',anim,334,575,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items_add/Varezhka2.png',0,0,59,60,1,0)
	anim:SetHotSpot(29,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Varezhka2',anim,751,237,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items_add/Zamok1.png',0,0,49,76,1,0)
	anim:SetHotSpot(24,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Zamok1',anim,745,638,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items_add/Zamok2.png',0,0,52,35,1,0)
	anim:SetHotSpot(26,17)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Zamok2',anim,254,586,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Items_add/Zamok3.png',0,0,44,55,1,0)
	anim:SetHotSpot(22,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Zamok3',anim,581,110,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Layers_add/BG_Varezhka1.png',0,0,62,44,1,0)
	anim:SetHotSpot(31,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Varezhka1',anim,342,534,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Layers_add/BG_Varezhka2.png',0,0,90,96,1,0)
	anim:SetHotSpot(45,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Varezhka2',anim,752,215,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/05_Metrodotel_Hall/Zone_HO_Cherdak/Layers_add/BG_Zamok3.png',0,0,26,19,1,0)
	anim:SetHotSpot(13,9)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Zamok3',anim,588,93,102,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
