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('stained_glass'):SetOpacity(0)
	play_field:GetObject('sprait_vitraja'):SetOpacity(0)
	play_field:GetObject('sparkle'):SetOpacity(0)
		
	game_state.meta_object = 'cigar33'
end

function OnSceneFree(screen)
    FreeData(screen)
end

function FireParticles()
	play_field:GetObject('1'):AddParticleSystem('data/ParticleSystem/AltarSparkles.psi', 
                                                                     play_field:GetObject('sparkle'):GetAnimationPtr());
	play_field:GetObject('2'):AddParticleSystem('data/ParticleSystem/AltarSparkles.psi', 
                                                                     play_field:GetObject('sparkle'):GetAnimationPtr());
	play_field:GetObject('3'):AddParticleSystem('data/ParticleSystem/AltarSparkles.psi', 
                                                                     play_field:GetObject('sparkle'):GetAnimationPtr());
	play_field:GetObject('4'):AddParticleSystem('data/ParticleSystem/AltarSparkles.psi', 
                                                                     play_field:GetObject('sparkle'):GetAnimationPtr());
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 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_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function LoadData(screen)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/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,90,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/ball.png',0,0,26,28,1,0)
	anim:SetHotSpot(13,14)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ball',anim,834,372,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/bell.png',0,0,21,31,1,0)
	anim:SetHotSpot(10,15)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bell',anim,271,247,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/bird.png',0,0,45,50,1,0)
	anim:SetHotSpot(22,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('bird',anim,1001,191,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/clew.png',0,0,52,60,1,0)
	anim:SetHotSpot(26,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('clew',anim,391,703,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/cross.png',0,0,37,82,1,0)
	anim:SetHotSpot(18,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cross',anim,848,50,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/cup1.png',0,0,73,52,1,0)
	anim:SetHotSpot(36,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cup1',anim,978,675,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/cup2.png',0,0,53,46,1,0)
	anim:SetHotSpot(26,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cup2',anim,355,592,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/fan.png',0,0,77,59,1,0)
	anim:SetHotSpot(38,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fan',anim,694,181,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/hat.png',0,0,66,49,1,0)
	anim:SetHotSpot(33,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hat',anim,299,176,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/keys.png',0,0,53,31,1,0)
	anim:SetHotSpot(26,15)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('keys',anim,526,745,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/lizzard.png',0,0,59,38,1,0)
	anim:SetHotSpot(29,19)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('lizzard',anim,806,454,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/ship.png',0,0,68,73,1,0)
	anim:SetHotSpot(34,36)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('ship',anim,536,129,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/skull.png',0,0,45,44,1,0)
	anim:SetHotSpot(22,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('skull',anim,789,287,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/spider.png',0,0,52,49,1,0)
	anim:SetHotSpot(26,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('spider',anim,626,28,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/starfish.png',0,0,54,53,1,0)
	anim:SetHotSpot(27,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('starfish',anim,930,128,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Layers/sprait_vitraja.png',0,0,82,83,1,0)
	anim:SetHotSpot(41,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprait_vitraja',anim,737,51,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/glasses1.png',0,0,58,36,1,0)
	anim:SetHotSpot(29,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('glasses1',anim,489,574,115,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/glasses2.png',0,0,72,36,1,0)
	anim:SetHotSpot(36,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('glasses2',anim,248,745,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Animations/1/1.png',0,0,92,39,1,0)
	anim:SetHotSpot(46,15)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('1',anim,266,527,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Animations/1/2.png',0,0,109,60,1,0)
	anim:SetHotSpot(54,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('2',anim,603,681,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Animations/1/3.png',0,0,89,36,1,0)
	anim:SetHotSpot(42,18)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('3',anim,832,559,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Animations/1/4.png',0,0,67,29,1,0)
	anim:SetHotSpot(30,12)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('4',anim,503,452,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Effect/particles.png',64,64,32,32,1,0)
	anim:SetHotSpot(16,16)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sparkle',anim,299,28,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/stained_glass.png',0,0,153,83,1,0)
	anim:SetHotSpot(76,41)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('stained_glass',anim,686,634,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('stained_glass_active_zone',anim,826,592,105,0,8,8)
	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('stained_glass_in_hand_active_zone',anim,736,44,100,0,8,8)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Layers/sprait_vitraja_3.png',0,0,140,81,1,0)
	anim:SetHotSpot(70,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprait_vitraja_3',anim,688,635,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Layers/stone_cover.png',0,0,520,230,1,0)
	anim:SetHotSpot(260,115)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('stone_cover',anim,574,546,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Layers/sprait_sapogi.png',0,0,80,71,1,0)
	anim:SetHotSpot(40,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprait_sapogi',anim,833,523,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Zoom/zoombg.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('zoombg',anim,512,384,300,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Zoom/glass3.png',0,0,194,189,1,0)
	anim:SetHotSpot(97,94)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('glass3',anim,506,326,310,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('urn_active_zone',anim,706,602,100,0,8,8)
	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_3',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_4',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/33_after_altar_13/Items/brush.png',0,0,51,75,1,0)
	anim:SetHotSpot(25,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('brush',anim,296,471,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/leaf.png',0,0,63,44,1,0)
	anim:SetHotSpot(31,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('leaf',anim,761,564,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/Items/palmprint.png',0,0,53,53,1,0)
	anim:SetHotSpot(26,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('palmprint',anim,542,357,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/33_after_altar_13/cigar33.png',0,0,81,57,1,0)
	anim:SetHotSpot(40,28)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('cigar33',anim,588,640,100,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
