function OnSceneLoad(screen)
    LoadData(screen)
    DefaultOnSceneLoad('data/Scenes/17_Bedroom_Mirror_HO.lua', 'hidden_object', 'data/Scenes/17_Bedroom_Main.lua')
    
    local anim = play_field:GetObject('shadow_anim'):GetAnimation();
    anim:Stop();
    play_field:GetObject('shadow_anim'):SetVisible(false);
    
    if not HasGameState('ActionCompleted', game_state.scene_path.."(MonkeyShown)") then
        play_field:TimerDoString("ShowMakaka();", 1);
    end
    
    AddTask(CreateTask('PIPETTE', '', 'Pipette'))
    
    AddRandomTasks( CreateTask('BIRD',             '', 'Bird'),
                    CreateTask('BOTTLE',           '', 'Bottle'),
                    CreateTask('CANDY',            '', 'Candy'),
                    CreateTask('TRUNK',            '', 'Casket'),
                    CreateTask('CHRISTMAS_BALL',   '', 'ChristmasBall'),
                    CreateTask('DRAFTING_COMPASS', '', 'Compasses'),
                    CreateTask('GERBERA',          '', 'Gerbera'),
                    CreateTask('IRON',             '', 'Iron'),
                    CreateTask('JUG',              '', 'Jug'),
                    CreateTask('KEY',              '', 'Key'),
                    CreateTask('TASSEL',           '', 'KeyRing'),
                    CreateTask('LAMP',             '', 'Lamp'),
                    CreateTask('YELLOW_LEAF',      '', 'Leaf'),
                    CreateTask('ONION',            '', 'Onion'),
                    CreateTask('ORANGE',           '', 'Orange'),
                    CreateTask('PEN',              '', 'Pen'),
                    CreateTask('PINCE_NEZ',        '', 'PinceNez'),
                    CreateTask('RIBBON',           '', 'Ribbon'),
                    CreateTask('SACK',             '', 'Sac'),
                    CreateTask('SCALES',           '', 'Scales'),
                    CreateTask('SMALL_BAG',        '', 'SmallBag'),
                    CreateTask('SNAIL',            '', 'Snail'),
                    CreateTask('TRIANGLE',         '', 'Triangle'),
                    CreateTask('UMBRELLA',         '', 'Umbrella'));
    
    RegisterToolFindInfo('17_pipette');
end

function ShowMakaka()
    AddGameState('ActionCompleted', game_state.scene_path.."(MonkeyShown)")
    
    play_field:GetObject('shadow_anim'):SetVisible(true);
    
    local anim = play_field:GetObject('shadow_anim'):GetAnimation();
    anim:SetMode(HGEANIM_FWD + HGEANIM_NOLOOP);
    anim:Play();
    PlaySound('02_Horror')
    
    play_field:TimerDoString("play_field:GetObject('shadow_anim'):SetVisible(false);", GetAnimationLength(anim));
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/17_Bedroom/Zone_HO_mirror/Layers/background.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('background',anim,512,384,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Bird.png',0,0,86,76,1,0)
	anim:SetHotSpot(43,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Bird',anim,341,179,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Bottle.png',0,0,63,174,1,0)
	anim:SetHotSpot(31,87)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Bottle',anim,882,535,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Candy.png',0,0,47,37,1,0)
	anim:SetHotSpot(23,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Candy',anim,864,516,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Casket.png',0,0,201,141,1,0)
	anim:SetHotSpot(100,70)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Casket',anim,372,625,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/ChristmasBall.png',0,0,42,63,1,0)
	anim:SetHotSpot(21,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ChristmasBall',anim,917,39,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Gerbera.png',0,0,56,53,1,0)
	anim:SetHotSpot(28,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Gerbera',anim,885,642,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Iron.png',0,0,76,100,1,0)
	anim:SetHotSpot(38,50)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Iron',anim,758,411,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Jug.png',0,0,91,190,1,0)
	anim:SetHotSpot(45,95)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Jug',anim,417,620,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Key.png',0,0,53,66,1,0)
	anim:SetHotSpot(26,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Key',anim,641,512,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/KeyRing.png',0,0,37,100,1,0)
	anim:SetHotSpot(18,50)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('KeyRing',anim,467,135,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Lamp.png',0,0,53,94,1,0)
	anim:SetHotSpot(26,47)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Lamp',anim,362,409,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Leaf.png',0,0,72,65,1,0)
	anim:SetHotSpot(36,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Leaf',anim,989,344,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Orange.png',0,0,60,53,1,0)
	anim:SetHotSpot(30,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Orange',anim,921,540,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Pen.png',0,0,101,20,1,0)
	anim:SetHotSpot(50,10)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Pen',anim,742,620,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Ribbon.png',0,0,43,79,1,0)
	anim:SetHotSpot(21,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Ribbon',anim,247,232,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Sac.png',0,0,86,80,1,0)
	anim:SetHotSpot(43,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Sac',anim,49,445,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Scales.png',0,0,89,120,1,0)
	anim:SetHotSpot(44,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Scales',anim,552,134,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/SmallBag.png',0,0,129,85,1,0)
	anim:SetHotSpot(64,42)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('SmallBag',anim,609,557,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Snail.png',0,0,84,52,1,0)
	anim:SetHotSpot(42,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Snail',anim,767,112,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Umbrella.png',0,0,226,76,1,0)
	anim:SetHotSpot(113,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Umbrella',anim,544,579,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Layers/Layer_yumba.png',0,0,236,49,1,0)
	anim:SetHotSpot(118,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_yumba',anim,581,528,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Layers/Layer_nogka.png',0,0,53,175,1,0)
	anim:SetHotSpot(26,87)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_nogka',anim,365,622,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Layers/Layer_krovat.png',0,0,79,116,1,0)
	anim:SetHotSpot(39,58)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_krovat',anim,153,440,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Triangle.png',0,0,69,90,1,0)
	anim:SetHotSpot(34,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Triangle',anim,609,499,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Compasses.png',0,0,78,80,1,0)
	anim:SetHotSpot(39,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Compasses',anim,545,504,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Pipette.png',0,0,62,62,1,0)
	anim:SetHotSpot(31,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Pipette',anim,497,495,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Layers/Layer_banka.png',0,0,131,140,1,0)
	anim:SetHotSpot(65,70)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_banka',anim,884,583,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Layers/Layer_sac.png',0,0,94,81,1,0)
	anim:SetHotSpot(47,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_sac',anim,42,476,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Layers/Layer_onion_pinceNez.png',0,0,48,60,1,0)
	anim:SetHotSpot(24,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_onion_pinceNez',anim,849,654,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Animations/shadow_anim.png',0,0,237,229,6,12)
	anim:SetHotSpot(118,114)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('shadow_anim',anim,555,284,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/Onion.png',0,0,34,36,1,0)
	anim:SetHotSpot(17,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Onion',anim,215,478,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Items/PinceNez.png',0,0,82,43,1,0)
	anim:SetHotSpot(41,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('PinceNez',anim,797,601,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Layers/BG_Onion.png',0,0,26,33,1,0)
	anim:SetHotSpot(13,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Onion',anim,202,474,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/17_Bedroom/Zone_HO_mirror/Layers/BG_PinceNez.png',0,0,63,54,1,0)
	anim:SetHotSpot(31,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_PinceNez',anim,814,596,102,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
