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('machine'):SetVisible(true);
    play_field:GetObject('magnet_layer'):SetVisible(false);
    play_field:GetObject('machine'):SetVisible(false);
  
	game_state.meta_object = 'cigar23'
end

function OnMinigameCompleted()
end

--[[function PlayAnimationPeriodically(anim_name, period)
    local anim_obj = play_field:GetObject(anim_name);
	local time_anim = GetAnimationLength(anim_obj:GetAnimation());
	local effector   = CreateAnimationEffector()
    effector:AttachTo(anim_obj)
    effector:SetMode(_ANIM_LOOP)
    effector:SetKey(_TRACK_O, 0.,                     1.);
    effector:SetKey(_TRACK_O, time_anim - 0.0001,     1.);
    effector:SetKey(_TRACK_O, time_anim,              0.);
    effector:SetKey(_TRACK_O, period * time_anim - 0.0001, 0.);
    effector:SetKey(_TRACK_O, period * time_anim,          1.);
    effector:Play();
end]]

function OnSceneFree(screen)
    FreeData(screen)
end

function OnUpdate(dt)
end

function OnScreenShown()
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 OnObjectWillBeFound(object)
end

function OnObjectWasFound(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

-- 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/23_ dump_cars_10/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/23_ dump_cars_10/Animation/mechanism.dds',0,0,209,328,10,10)
	anim:SetHotSpot(105,164)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('mechanism',anim,909,308,90,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Layers/mechanism_layer.png',0,0,229,330,1,0)
	anim:SetHotSpot(114,165)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('mechanism_layer',anim,907,309,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_inventory_pinion',anim,912,305,100,0,14,32)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/pinion_1.png',0,0,92,75,1,0)
	anim:SetHotSpot(46,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pinion_1',anim,903,503,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/pinion_1.png',0,0,92,75,1,0)
	anim:SetHotSpot(46,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pinion_1_tool',anim,768,484,1,0,0.8,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/pinion_1.png',0,0,92,75,1,0)
	anim:SetHotSpot(46,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pinion_1_tool_visual_inventory',anim,769,485,1,0,0.8,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/pinion_2.png',0,0,44,53,1,0)
	anim:SetHotSpot(22,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pinion_2',anim,483,339,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/pinion_2.png',0,0,44,53,1,0)
	anim:SetHotSpot(22,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pinion_2_tool',anim,925,582,1,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/pinion_2.png',0,0,44,53,1,0)
	anim:SetHotSpot(22,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pinion_2_tool_visual_inventory',anim,925,582,1,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Zoom/wheel_zoom.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('wheel_zoom',anim,512,384,500,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Zoom/pinion_3.png',0,0,152,121,1,0)
	anim:SetHotSpot(76,60)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pinion_3',anim,457,494,505,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Zoom/pinion_3.png',0,0,152,121,1,0)
	anim:SetHotSpot(76,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pinion_3_tool',anim,512,384,1,0,0.5,0.5)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Zoom/pinion_3.png',0,0,152,121,1,0)
	anim:SetHotSpot(76,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pinion_3_tool_visual_inventory',anim,512,384,1,0,0.5,0.5)
	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_zoom_wheel',anim,653,661,100,0,7,7)
	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_comics_1',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('pixel_comics_2',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('pixel_comics_3',anim,512,384,401,0,128,96)
	local anim = CreateAnimation('data/Texture/Comics/Sheriff.dds',0,0,530,636,1,0)
	anim:SetHotSpot(266,256)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Sheriff',anim,756,390,400,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Animation/machine.dds',0,0,304,194,5,10)
	anim:SetHotSpot(152,97)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('machine',anim,613,432,160,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Layers/magnet_layer.png',0,0,341,440,1,0)
	anim:SetHotSpot(170,220)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('magnet_layer',anim,590,-26,165,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/cigar23.png',0,0,64,31,1,0)
	anim:SetHotSpot(32,15)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cigar23',anim,322,756,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/anvil.png',0,0,118,79,1,0)
	anim:SetHotSpot(59,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('anvil',anim,581,517,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/bell.png',0,0,96,93,1,0)
	anim:SetHotSpot(48,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bell',anim,590,69,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/boot.png',0,0,73,65,1,0)
	anim:SetHotSpot(36,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('boot',anim,564,664,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/box.png',0,0,107,72,1,0)
	anim:SetHotSpot(53,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('box',anim,411,678,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/brush.png',0,0,100,94,1,0)
	anim:SetHotSpot(50,47)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('brush',anim,291,580,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/BUCKET.png',0,0,83,90,1,0)
	anim:SetHotSpot(41,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BUCKET',anim,274,424,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/chair.png',0,0,148,119,1,0)
	anim:SetHotSpot(74,59)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('chair',anim,944,512,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/column.png',0,0,94,99,1,0)
	anim:SetHotSpot(47,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('column',anim,775,259,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/crocodile.png',0,0,49,85,1,0)
	anim:SetHotSpot(24,42)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('crocodile',anim,337,297,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/elephant.png',0,0,111,84,1,0)
	anim:SetHotSpot(55,42)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('elephant',anim,576,311,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/fish.png',0,0,50,62,1,0)
	anim:SetHotSpot(25,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fish',anim,790,319,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/glasses.png',0,0,66,74,1,0)
	anim:SetHotSpot(33,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('glasses',anim,700,667,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/gloves.png',0,0,107,107,1,0)
	anim:SetHotSpot(53,53)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('gloves',anim,669,592,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/hare.png',0,0,85,90,1,0)
	anim:SetHotSpot(42,45)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hare',anim,278,515,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/hat.png',0,0,83,41,1,0)
	anim:SetHotSpot(41,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hat',anim,834,418,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/helmet.png',0,0,124,128,1,0)
	anim:SetHotSpot(62,64)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('helmet',anim,469,575,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/HOOKAH.png',0,0,70,100,1,0)
	anim:SetHotSpot(35,50)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('HOOKAH',anim,663,504,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/HOURGLASS.png',0,0,91,59,1,0)
	anim:SetHotSpot(45,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('HOURGLASS',anim,310,633,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/iron.png',0,0,45,52,1,0)
	anim:SetHotSpot(22,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('iron',anim,256,84,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/jerrican.png',0,0,68,65,1,0)
	anim:SetHotSpot(34,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('jerrican',anim,409,362,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/Lasty.png',0,0,70,63,1,0)
	anim:SetHotSpot(35,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Lasty',anim,423,420,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/road_distributor.png',0,0,67,36,1,0)
	anim:SetHotSpot(33,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('road_distributor',anim,285,321,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/ship.png',0,0,78,113,1,0)
	anim:SetHotSpot(39,56)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ship',anim,877,66,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/shoe.png',0,0,71,82,1,0)
	anim:SetHotSpot(35,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('shoe',anim,989,683,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/shovel.png',0,0,87,64,1,0)
	anim:SetHotSpot(43,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('shovel',anim,354,526,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/star.png',0,0,88,61,1,0)
	anim:SetHotSpot(44,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('star',anim,944,580,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/Stupka.png',0,0,105,79,1,0)
	anim:SetHotSpot(52,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Stupka',anim,831,529,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/tap.png',0,0,94,82,1,0)
	anim:SetHotSpot(47,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('tap',anim,812,703,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/TRUMPET.png',0,0,74,71,1,0)
	anim:SetHotSpot(37,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('TRUMPET',anim,726,398,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/tvset.png',0,0,75,70,1,0)
	anim:SetHotSpot(37,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('tvset',anim,532,239,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/Vase.png',0,0,77,93,1,0)
	anim:SetHotSpot(38,46)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Vase',anim,400,318,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/wolf.png',0,0,82,107,1,0)
	anim:SetHotSpot(41,53)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('wolf',anim,334,132,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Items/box_with_instrument.png',0,0,92,59,1,0)
	anim:SetHotSpot(46,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('box_with_instrument',anim,340,362,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Layers/star_layer.png',0,0,38,48,1,0)
	anim:SetHotSpot(19,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('star_layer',anim,938,575,115,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Layers/bucket_layer.png',0,0,62,36,1,0)
	anim:SetHotSpot(31,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bucket_layer',anim,273,459,115,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Layers/tvset_layer.png',0,0,76,55,1,0)
	anim:SetHotSpot(38,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('tvset_layer',anim,530,255,115,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Layers/elephant_layer.png',0,0,106,40,1,0)
	anim:SetHotSpot(53,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xBBAFFFAF')
	screen:CreateObject('elephant_layer',anim,567,347,115,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Layers/pinion_2_layer.png',0,0,42,53,1,0)
	anim:SetHotSpot(21,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('pinion_2_layer',anim,484,342,115,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Layers/boot_layer.png',0,0,55,74,1,0)
	anim:SetHotSpot(27,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('boot_layer',anim,577,648,115,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Layers/glasses_layer.png',0,0,19,25,1,0)
	anim:SetHotSpot(9,12)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('glasses_layer',anim,707,639,115,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_ dump_cars_10/Layers/column_layer.png',0,0,34,64,1,0)
	anim:SetHotSpot(17,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('column_layer',anim,809,245,115,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
