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('minigame_active'):SetVisible(false);
	---------------------------------------------------------
	play_field:GetObject('pixel_bubble'):SetOpacity(0.0);
	
	GoParticleSparkling();
	
	-------------------------------------------------------------------------------------------------------------------	
	game_state.meta_object = 'cigar19'
end

function OnUpdateParticle()
    local sparkling_obj = play_field:GetObject('pixel_bubble');
    if sparkling_obj ~= nil then
        local particlesystem_sparkling = play_field:GetObject('pixel_bubble'):GetParticleSystem();
        if particlesystem_sparkling ~= nil and
            particlesystem_sparkling:GetParticleSystem():GetParticlesAlive() == 0 and
            particlesystem_sparkling:GetParticleSystem():GetAge() == -2.  then
            local random_time = math.random(1, 3);
            TimerDo(play_field:GetTimer(), random_time, GoParticleSparkling );
            play_field:GetObject('pixel_bubble'):RemoveParticleSystem();
        end
    end
    
    if(play_field:GetObject('pixel_bubble'):GetX() <= 490) then
		play_field:GetObject('pixel_bubble'):Move(60, 0, math.random(50) / 100 + 0.2);
	end
	if(play_field:GetObject('pixel_bubble'):GetX() >= 550) then
		play_field:GetObject('pixel_bubble'):Move(-60, 0, math.random(50) / 100 + 0.2);
	end
end

function GoParticleSparkling()
    play_field:GetObject('pixel_bubble'):AddParticleSystem('data/ParticleSystem/Loc19_bubble.psi', play_field:GetObject('sparkle'):GetAnimationPtr())
end

function OnNotebookOpened()
end


function OnSceneFree(screen)
    FreeData(screen)
end

function OnUpdate(dt)
	OnUpdateParticle();
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    
end

function OnObjectMouseUp(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 OnMinigameCompleted()
end

-- CLEAR_ON_SAVE_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/19_ gas-station_ shop_8/Items/bell.png',0,0,38,83,1,0)
	anim:SetHotSpot(19,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bell',anim,756,174,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/card.png',0,0,27,36,1,0)
	anim:SetHotSpot(13,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('card',anim,687,321,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/fire-extinguisher.png',0,0,57,59,1,0)
	anim:SetHotSpot(28,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fire-extinguisher',anim,247,722,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/footprint.png',0,0,34,70,1,0)
	anim:SetHotSpot(17,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('footprint',anim,982,721,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/glasses.png',0,0,68,33,1,0)
	anim:SetHotSpot(34,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('glasses',anim,624,483,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/ice-cream.png',0,0,53,41,1,0)
	anim:SetHotSpot(26,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ice-cream',anim,363,483,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/map.png',0,0,102,132,1,0)
	anim:SetHotSpot(51,66)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('map',anim,660,614,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/monkey.png',0,0,53,42,1,0)
	anim:SetHotSpot(26,21)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('monkey',anim,693,265,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/palm_print.png',0,0,22,25,1,0)
	anim:SetHotSpot(11,12)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('palm_print',anim,500,346,105,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/rolling_pin.png',0,0,112,63,1,0)
	anim:SetHotSpot(56,31)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('rolling_pin',anim,985,527,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/rose.png',0,0,34,31,1,0)
	anim:SetHotSpot(17,15)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('rose',anim,441,218,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/Santa_Claus.png',0,0,33,49,1,0)
	anim:SetHotSpot(16,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Santa_Claus',anim,425,525,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/shawl.png',0,0,43,67,1,0)
	anim:SetHotSpot(21,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('shawl',anim,880,705,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/starfish.png',0,0,37,33,1,0)
	anim:SetHotSpot(18,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('starfish',anim,555,277,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/starfish_2.png',0,0,52,51,1,0)
	anim:SetHotSpot(26,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('starfish_2',anim,935,241,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/sun.png',0,0,37,36,1,0)
	anim:SetHotSpot(18,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sun',anim,521,449,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/clock_bell.png',0,0,49,33,1,0)
	anim:SetHotSpot(24,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('clock_bell',anim,660,669,132,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/clock_bell_2.png',0,0,43,29,1,0)
	anim:SetHotSpot(21,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('clock_bell_2',anim,856,487,132,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/alarm_clock.png',0,0,55,58,1,0)
	anim:SetHotSpot(27,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('alarm_clock',anim,368,433,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/clock_bell.png',0,0,49,33,1,0)
	anim:SetHotSpot(24,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('2clock_bell',anim,660,669,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/clock_bell_2.png',0,0,43,29,1,0)
	anim:SetHotSpot(21,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('2clock_bell_2',anim,856,487,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/alarm_clock.png',0,0,55,58,1,0)
	anim:SetHotSpot(27,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('2alarm_clock',anim,368,433,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/alarm_clock_2.png',0,0,45,56,1,0)
	anim:SetHotSpot(22,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('alarm_clock_2',anim,861,268,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Layers/sprait_polki.png',0,0,105,70,1,0)
	anim:SetHotSpot(52,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprait_polki',anim,886,271,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Layers/sprait_skalki.png',0,0,77,70,1,0)
	anim:SetHotSpot(38,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprait_skalki',anim,945,527,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/money-box.png',0,0,48,53,1,0)
	anim:SetHotSpot(24,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('money-box',anim,887,270,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('area_clock',anim,856,268,115,0,10,10)
	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('area_zoom',anim,755,469,100,0,10,10)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/zoom/bak.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('zoom_bak',anim,511,384,11,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('area_device',anim,515,430,12,0,10,10)
	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/Common/pixel.jpg',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('pixel',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/Refueller.png',0,0,404,636,1,0)
	anim:SetHotSpot(202,318)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Refueller',anim,817,453,40,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Layers/sprait_bara.png',0,0,152,138,1,0)
	anim:SetHotSpot(76,69)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprait_bara',anim,859,475,131,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('minigame_active',anim,524,492,13,0,20,30)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Animation/vodorosl.png',0,0,47,107,25,10)
	anim:SetHotSpot(23,53)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('vodorosl',anim,513,379,98,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Animation/nkl.png',0,0,134,280,1,0)
	anim:SetHotSpot(67,140)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('nkl',anim,520,339,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Animation/bylb.png',0,0,28,70,10,10)
	anim:SetHotSpot(14,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bylb',anim,564,424,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/fon1.png',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fon1',anim,512,384,95,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Animation/blv.png',0,0,10,13,10,10)
	anim:SetHotSpot(5,6)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('blv',anim,600,364,110,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('0xFFFFFFFF')
	screen:CreateObject('pixel_bubble',anim,490,458,99,0,1,1)
	local anim = CreateAnimation('data/Texture/Effect/particles.png',64,96,32,32,1,0)
	anim:SetHotSpot(16,16)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('sparkle',anim,584,254,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/smile.png',0,0,28,26,1,0)
	anim:SetHotSpot(14,13)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('smile',anim,406,274,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/leaf.png',0,0,63,23,1,0)
	anim:SetHotSpot(31,11)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('leaf',anim,480,592,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/cherries.png',0,0,39,54,1,0)
	anim:SetHotSpot(19,27)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cherries',anim,348,634,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/Items/rose_2.png',0,0,75,41,1,0)
	anim:SetHotSpot(37,20)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('rose_2',anim,722,458,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/19_ gas-station_ shop_8/cigar19.png',0,0,132,68,1,0)
	anim:SetHotSpot(66,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cigar19',anim,818,554,100,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
