function OnSceneLoad(screen)
    game_state = {}    
    LoadData(screen)
    local pf = play_field
    local level = pf:GetLevelScreen()
    game_state.custom_cursors = {}
    game_state.locked_objects = {}
    --level:AddTaskSafe(CreateTask('', '', ''))
    --zone = CreateZoomZone('')
    game_state.locker = ReferenceCounter()
    game_state.active_zone = nil
    game_state.inventory_zones = {}
    game_state.active_objects = {}
	
	play_field:GetObject('door'):GetAnimation():Stop()
	play_field:GetObject('door'):GetAnimation():SetMode(HGEANIM_NOLOOP)
	
	game_state.fire_sound = CreateSoundEntity('8_Fire');
	game_state.fire_sound:AttachTo(play_field)
	game_state.fire_sound:Play(true)
	game_state.meta_object = 'cigar8'
end


function OnNotebookOpened()
    --OnSceneStateChanged(play_field)
end


function OnScreenShown()
end

function OnSceneFree(screen)
    FreeData(screen)
end

function OnUpdate(dt)
end

function OnExit()
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)

    if is_wrong_click then
        --pf:ShowWrongObjectEffect()
    end

    return is_wrong_click;    
end

function OnObjectMouseUp(object)
end

function OnObjectWasFound(object)  
end

function OnObjectWillBeFound(object)
end

function OnToolFound(tool)
end

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

function OnObjectReachPanel(object)
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
end

function OnMouseMove(previous_pos, current_pos)
end

function OnSetTool(tool)
end

function CanBeHinted(obj)
    if locked_object[obj] ~= true then
        return true
    else
        return false
    end
end

function OnLostFocus()
end

function OnGainFocus()
end

function OnMinigameCompleted()
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/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('barrel_active_zone',anim,985,413,100,0,10,4)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Animations/ogn.dds',0,0,48,116,21,10)
	anim:SetHotSpot(24,58)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ogn',anim,893,374,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/bak.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bak',anim,512,384,87,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Animations/door.dds',0,0,244,149,6,10)
	anim:SetHotSpot(122,75)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('door',anim,755,380,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/zoom/fireextinguisher.png',0,0,371,295,1,0)
	anim:SetHotSpot(85,147)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('fireextinguisher',anim,470,476,201,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/zoom/keg_bak.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('keg_bak',anim,512,384,200,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('fire',anim,894,374,105,0,5,16)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/ash02.png',0,0,158,54,1,0)
	anim:SetHotSpot(79,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ash',anim,825,394,96,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('pixel1',anim,512,384,401,0,128,96)
	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('pixel2',anim,512,384,401,0,128,96)
	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('pixel3',anim,512,384,401,0,128,96)
	local anim = CreateAnimation('data/Texture/Comics/Service_Manager.dds',0,0,661,696,1,0)
	anim:SetHotSpot(330,348)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Service_Manager',anim,521,422,400,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/Sheriff.dds',0,0,532,636,1,0)
	anim:SetHotSpot(266,256)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Sheriff',anim,734,390,400,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/eyes.png',0,0,79,33,1,0)
	anim:SetHotSpot(39,16)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('eyes',anim,369,212,500,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/SMmask.png',0,0,203,61,1,0)
	anim:SetHotSpot(101,30)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('SMMask',anim,545,160,410,0,1,1)
	local anim = CreateAnimation('data/Texture/Comics/eyes_sm.png',0,0,142,22,1,0)
	anim:SetHotSpot(71,11)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('eyes_sm',anim,729,163,405,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/shovel.png',0,0,46,224,1,0)
	anim:SetHotSpot(23,112)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('shovel',anim,554,548,110,-25,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/shovel.png',0,0,46,224,1,0)
	anim:SetHotSpot(23,112)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('shovel_scaled',anim,541,536,100,235,0.4,0.4)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/crawbar.png',0,0,181,37,1,0)
	anim:SetHotSpot(90,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('crawbar',anim,733,601,100,-9,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/brush.png',0,0,66,88,1,0)
	anim:SetHotSpot(33,44)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('brush',anim,923,590,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/axe.png',0,0,78,86,1,0)
	anim:SetHotSpot(39,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('axe',anim,815,204,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/ball1.png',0,0,52,48,1,0)
	anim:SetHotSpot(26,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ball1',anim,376,582,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/binocular.png',0,0,57,32,1,0)
	anim:SetHotSpot(28,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('binocular',anim,572,456,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/cup1.png',0,0,74,67,1,0)
	anim:SetHotSpot(37,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cup1',anim,877,721,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/cup2.png',0,0,37,39,1,0)
	anim:SetHotSpot(18,19)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cup2',anim,547,469,109,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/glove_pair2.png',0,0,72,82,1,0)
	anim:SetHotSpot(36,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('glove_pair2',anim,983,672,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/hat.png',0,0,48,48,1,0)
	anim:SetHotSpot(24,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hat',anim,653,60,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/pincers.png',0,0,31,87,1,0)
	anim:SetHotSpot(15,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pincers',anim,922,171,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/star1.png',0,0,64,62,1,0)
	anim:SetHotSpot(32,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('star1',anim,250,39,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/star2.png',0,0,115,75,1,0)
	anim:SetHotSpot(57,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('star2',anim,591,729,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/button.png',0,0,21,24,1,0)
	anim:SetHotSpot(10,12)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('button',anim,450,380,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/chain.png',0,0,25,142,1,0)
	anim:SetHotSpot(12,71)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('chain',anim,795,107,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/compass.png',0,0,68,32,1,0)
	anim:SetHotSpot(34,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('compass',anim,750,639,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/note.png',0,0,39,45,1,0)
	anim:SetHotSpot(19,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('note',anim,987,263,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/pine.png',0,0,41,46,1,0)
	anim:SetHotSpot(20,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pine',anim,391,116,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/spring.png',0,0,42,73,1,0)
	anim:SetHotSpot(21,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('spring',anim,447,181,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/glove_pair.png',0,0,107,77,1,0)
	anim:SetHotSpot(53,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('glove_pair',anim,259,722,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/sprajt_binoklej.png',0,0,47,56,1,0)
	anim:SetHotSpot(23,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprajt_binoklej',anim,541,449,104,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/alarm_clock.png',0,0,44,60,1,0)
	anim:SetHotSpot(22,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('alarm_clock',anim,520,377,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/sprajt_cepi.png',0,0,86,96,1,0)
	anim:SetHotSpot(43,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprajt_cepi',anim,777,48,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/sprajt_cirkulja.png',0,0,68,36,1,0)
	anim:SetHotSpot(34,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprajt_cirkulja',anim,777,635,130,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/sprajt_kruzhki02.png',0,0,61,93,1,0)
	anim:SetHotSpot(30,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprajt_kruzhki02',anim,361,468,109,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/sprajt_loma.png',0,0,130,65,1,0)
	anim:SetHotSpot(65,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprajt_loma',anim,859,593,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/sprajt_perchatok02.png',0,0,80,144,1,0)
	anim:SetHotSpot(40,72)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprajt_perchatok02',anim,299,646,107,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/sprajt_topora.png',0,0,72,87,1,0)
	anim:SetHotSpot(36,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprajt_topora',anim,661,395,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/hammer.png',0,0,126,60,1,0)
	anim:SetHotSpot(63,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hammer',anim,858,650,100,16,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/poker.png',0,0,68,206,1,0)
	anim:SetHotSpot(34,103)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('poker',anim,438,565,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/barrel_over.png',0,0,88,29,1,0)
	anim:SetHotSpot(44,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('barrel_over',anim,985,407,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/sprajt_budilnika.png',0,0,21,49,1,0)
	anim:SetHotSpot(10,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprajt_budilnika',anim,501,387,105,-10,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/sprajt_loma_kuvaldy.png',0,0,148,87,1,0)
	anim:SetHotSpot(74,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprajt_loma_kuvaldy',anim,761,644,105,28,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Layers/sprajt_shljapy.png',0,0,69,48,1,0)
	anim:SetHotSpot(34,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprajt_shljapy',anim,627,78,106,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/footprint.png',0,0,89,32,1,0)
	anim:SetHotSpot(44,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('footprint',anim,828,395,95,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/Items/flower.png',0,0,37,37,1,0)
	anim:SetHotSpot(18,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('flower',anim,853,220,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/8_basement_3/cigar8.png',0,0,118,60,1,0)
	anim:SetHotSpot(59,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cigar8',anim,462,702,100,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
