local zone_clock
local clock_center = Vector(486, 393)
local zone_poster
local target_angle_delta = M_PI / 180 * 8

function add_fibrillation_effector_lamp(obj)
	local duration = 2.20

	eff= CreateAnimationEffector()
	eff:AttachTo(obj)
	eff:SetMode(_ANIM_LOOP)

    local dopacity = -0.55

	eff:SetKey(_TRACK_O, 0.0, 1.0 + dopacity)
	eff:SetKey(_TRACK_O, duration * 1.0/4.0, 0.95 + dopacity)
	eff:SetKey(_TRACK_O, duration * 2.0/4.0, 1.0 + dopacity)
	eff:SetKey(_TRACK_O, duration * 3.0/4.0, 0.89 + dopacity)
	eff:SetKey(_TRACK_O, duration * 4.0/4.0, 1.0 + dopacity)
	eff:Play()
end

function OnSceneLoad(screen)
    LoadData(screen)
    DefaultOnSceneLoad('data/Scenes/09_Museum_Street_Main.lua', 'quest')

	RegisterQuestObjects('glass_mud_1', 'glass_mud_2', 'glass_mud_3', 'Layer_Rag', 'area_Zoom_Book', 'area_ho')

	LinkScene('area_hotell_street_evening', 'CursorDoorDown', 'data/Scenes/06_Hotel_Street_Evening_Main.lua', false)
    LinkScene('area_teatre_gate', 'CursorDoorUp', 'data/Scenes/12_Theatre_Gate_Main.lua', false)

    play_field:GetObject('stick'):GetAnimation():Stop()

    play_field:GetObject('area_clock'):SetMaxOpacity(0.001)

    zone_clock = CreateZoomZone('Layer_Door_closed',
                                'CloseZoneTable',
								'BG_Zoom_Door', true,
                                'Arrow_1', true,
                                'Arrow_2', true,
                                'Layer_Glass_Broken', false,
                                'Layer_Glass_Mid1', false,
                                'Layer_Glass_Mid2', false,
                                'Layer_Glass', true,
                                'stick', true,
                                'Zamok', true,
                                'Layer_Zamok_Perekrytie', true,
                                'Layer_Zamok_Over', true,
                                'area_clock', true)
    zone_clock.on_open = function()
        if HasGameState('ToolApplied', '08_stone') and HasGameState('ToolApplied', '08_rag') then
            RegisterActiveObject('area_clock',
                                 function()
                                     ShowMonolog('09_ClockOpen', 'C_09_CLOCK_OPEN')
                                 end,
                                 nil,
                                 true,
                                 'CursorGlass')
		end
		if HasGameState('ToolApplied', '08_stone') and not HasGameState('ToolApplied', '08_rag') then
            RegisterActiveObject('area_clock',
                                 function()
									ShowMonolog('09_FindProperTime', 'C_09_FIND_PROPER_TIME')
                                 end,
                                 nil,
                                 true,
                                 'CursorGlass')
		end
        if not HasGameState('ToolApplied', '08_stone') then
            RegisterActiveObject('Layer_Glass',
                                 function()
                                     ShowMonolog('09_ClockClose', 'C_09_CLOCK_CLOSE')
                                 end,
                                 nil,
                                 true,
                                 'CursorGlass')
        end
    end

    zone_poster = CreateZoomZone('area_poster',
								 'CloseZonePoster',
								 'BG_Zoom_Poster', true)
	zone_poster.on_open = function()
		game_state.ignore_on_highlight['area_poster'] = true
		AddGameState('IgnoreOnHighlight', 'area_poster')
	end

    play_field:GetObject('Layer_Door_Opened_Light_Mid'):SetOpacity(0.)
    play_field:GetObject('Layer_Door_Opened_Light_Final'):SetOpacity(0.)

    local on_stone_apply = function(tool_name, object_name)
        if object_name == 'Layer_Glass' then
            zone_clock.SetObjectVisible('Layer_Glass', false)
            zone_clock.SetObjectVisible('Layer_Glass_Mid1', true)
            play_field:GetObject('Layer_Glass'):ChangeOpacity(1., 0., 0.3)
            play_field:GetObject('Layer_Glass_Mid1'):ChangeOpacity(0., 1., 0.3)
            
            if not play_field.breakGlassSound
            then
                play_field.breakGlassSound = MakeSoundEntity("Break_clock_glass");
            end
            
            play_field.breakGlassSound:StopSound();
            play_field.breakGlassSound:Play(false);
            
        end
        if object_name == 'Layer_Glass_Mid1' then
            zone_clock.SetObjectVisible('Layer_Glass_Mid1', false)
            zone_clock.SetObjectVisible('Layer_Glass_Mid2', true)
            play_field:GetObject('Layer_Glass_Mid1'):ChangeOpacity(1., 0., 0.3)
            play_field:GetObject('Layer_Glass_Mid2'):ChangeOpacity(0., 1., 0.3)

            if not play_field.breakGlassSound
            then
                play_field.breakGlassSound = MakeSoundEntity("Break_clock_glass");
            end
            
            play_field.breakGlassSound:StopSound();
            play_field.breakGlassSound:Play(false);
        end
        if object_name == 'Layer_Glass_Mid2' then
            zone_clock.SetObjectVisible('Layer_Glass_Mid2', false)
            zone_clock.SetObjectVisible('Layer_Glass_Broken', true)
            play_field:GetObject('Layer_Glass_Mid2'):ChangeOpacity(1., 0., 0.3)
            play_field:GetObject('Layer_Glass_Broken'):ChangeOpacity(0., 1., 0.3)

            if not play_field.breakGlassSound
            then
                play_field.breakGlassSound = MakeSoundEntity("Break_clock_glass");
            end
            
            play_field.breakGlassSound:StopSound();
            play_field.breakGlassSound:Play(false);

            if HasGameState('ToolApplied', '08_rag') then
                ShowMonolog('09_ClockOpen', 'C_09_CLOCK_OPEN')
                RegisterActiveObject('area_clock',
                         function()
                             ShowMonolog('09_ClockOpen', 'C_09_CLOCK_OPEN')
                         end,
                         nil,
                         true,
                         'CursorGlass')
            else
                RegisterActiveObject('area_clock',
									 function()
										 ShowMonolog('09_FindProperTime', 'C_09_FIND_PROPER_TIME')
									 end,
									 nil,
									 true,
									 'CursorGlass')
                ShowMonolog('09_FindProperTime', 'C_09_FIND_PROPER_TIME')
            end
        end
    end
    local on_load_when_stone_applied = function(tool_name, object_name)
        if not object_name or object_name == 'Layer_Glass' then
            zone_clock.SetObjectVisible('Layer_Glass', false)
            zone_clock.SetObjectVisible('Layer_Glass_Mid1', true)
        end
        if not object_name or object_name == 'Layer_Glass_Mid1' then
            zone_clock.SetObjectVisible('Layer_Glass_Mid1', false)
            zone_clock.SetObjectVisible('Layer_Glass_Mid2', true)
        end
        if not object_name or object_name == 'Layer_Glass_Mid2' then
            zone_clock.SetObjectVisible('Layer_Glass_Mid2', false)
            zone_clock.SetObjectVisible('Layer_Glass_Broken', true)
        end
    end
    RegisterToolApplyInfo('08_stone', {'Layer_Glass', 'Layer_Glass_Mid1', 'Layer_Glass_Mid2'}, nil, nil, on_stone_apply, on_load_when_stone_applied)

    play_field:GetObject('Layer_Door_mid'):SetOpacity(0.)
    play_field:GetObject('Layer_Door_Opened'):SetOpacity(0.)

    local clock_finished = HasGameState('TaskComplete', '09_clock')

	if not HasGameState('09_arrow1_angle') then
		AddGameState('09_arrow1_angle', tostring(play_field:GetObject('Arrow_1'):GetAngle()))
		AddGameState('09_arrow2_angle', tostring(play_field:GetObject('Arrow_2'):GetAngle()))
	end

    if clock_finished then
        play_field:GetObject('Layer_Door_closed'):SetOpacity(0.)
        play_field:GetObject('Layer_Door_Opened'):SetOpacity(1.)
        play_field:GetObject('Layer_Door_Opened_Light_Mid'):SetOpacity(0.)
        play_field:GetObject('Layer_Door_Opened_Light_Final'):SetOpacity(1.)
		LinkHall()
    else
		if HasGameState('ToolApplied', '08_rag') then
			game_state.custom_cursors['Arrow_1'] = 'CursorActive'
			game_state.custom_cursors['Arrow_2'] = 'CursorActive'
		else
			game_state.custom_cursors['Arrow_1'] = 'CursorGlass'
			game_state.custom_cursors['Arrow_2'] = 'CursorGlass'
		end
		game_state.arrow1_finished = false
		game_state.arrow2_finished = false

		play_field:GetObject('Arrow_1'):SetAngle(tonumber(GetGameState('09_arrow1_angle'):Get(0)))
		play_field:GetObject('Arrow_2'):SetAngle(tonumber(GetGameState('09_arrow2_angle'):Get(0)))

		TestIfArrowInTargetAngle(play_field:GetObject('Arrow_1'))
		TestIfArrowInTargetAngle(play_field:GetObject('Arrow_2'))
	end

    --add_fibrillation_effector_lamp(play_field:GetObject('Layer_Light_L'))
    --add_fibrillation_effector_lamp(play_field:GetObject('Layer_Light_R'))
    local megoLight = MegoLightEffector();
    megoLight:AttachTo(play_field:GetObject('Layer_Light_L'));
    megoLight:Play();
    
    local megoLight = MegoLightEffector();
    megoLight:AttachTo(play_field:GetObject('Layer_Light_R'));
    megoLight:PlayAt(0.5);

    if HasGameState('ToolFound', '11_key') then
        game_state.ignore_on_highlight['area_museum_hall1'] = true
        play_field:GetObject('Layer_Door_Opened_Light_Final'):Hide()
    end
    
    RegisterActiveObject('area_window_right_1', ShowWindowComment, nil, true, 'CursorGlass');
    RegisterActiveObject('area_window_right_2', ShowWindowComment, nil, true, 'CursorGlass');

    play_field:IgnoreOnTestPoint('Layer_Glass_Broken')
    
    AddRatsComposition();
    
    LoadSound('09_rool_clock_arrow', 'data/Sound/09_Museum_street/Roll_clock_arrows.ogg')
    play_field.rollClockArrowSound = MakeSoundEntity('09_rool_clock_arrow');
end

function ShowWindowComment(obj_name)

    if (windowComments == nil)
    then
        windowComments = {'C_09_RIGHT_WINDOW_1',
                          'C_09_RIGHT_WINDOW_2',
                          'C_09_RIGHT_WINDOW_3'};
    end
    
    if (currentWindowComment == nil)
    then
        currentWindowComment = 1;
    end

    ShowMonolog('09_right_window_comment',
                windowComments[currentWindowComment]);
    currentWindowComment = currentWindowComment + 1;
    
    if (currentWindowComment > 3)
    then
        currentWindowComment = 1;
    end

	game_state.ignore_on_highlight[obj_name] = true
	AddGameState('IgnoreOnHighlight', obj_name)
	
end

function AddRatsComposition()

    createComposition17_Theatre_Entrance_rat = function()
    
        local composition17_Theatre_Entrance_rat = CreateCompositionSequence();
        local compositionDuration = 3.5;
        composition17_Theatre_Entrance_rat:SetDuration(compositionDuration);
    
    
        -- Layer Rat_eating
        local element = BuildRatEatingComposition();
        element:SetName("Rat_eating");
        composition17_Theatre_Entrance_rat:AddElement(element);
        element:SetHotSpot(512, 384);
        element:SetParentElement(composition17_Theatre_Entrance_rat);
        element:SetXY(240.770385742188, 641.945083618164);
    
        element:SetScaleX(-0.33151414309484);
        element:SetScaleY(0.28329450915141);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(0, 3.5);
    
    
        effector:Play();
    
    
        composition17_Theatre_Entrance_rat:Play();
    
        return composition17_Theatre_Entrance_rat;
    end
    
    local createCompositionRatRunning1 = function()
    
        local compositionRatRunning1 = CreateCompositionSequence();
        local compositionDuration = 3.5;
        compositionRatRunning1:SetDuration(compositionDuration);
        
        -- Layer Rat_running
        local element = BuildRatRunningComposition();
        element:SetName("Rat_running");
        compositionRatRunning1:AddElement(element);
        element:SetHotSpot(512, 384);
        element:SetParentElement(compositionRatRunning1);
        element:SetScaleX(-0.23);
        element:SetScaleY(0.23);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
        effector:SetLifeTime(1.08333333333333, 6.08333333333333);
    
        effector:SetKey(_TRACK_X, 1.08333333333333, -101.806991577148);
        effector:SetKey(_TRACK_Y, 1.08333333333333, 664.284530639648);
        effector:SetKey(_TRACK_X, 2.95833333333333, 552.921798706055);
        effector:SetKey(_TRACK_Y, 2.95833333333333, 781.677200317383);
    
        effector:Play();
        
        --compositionRatRunning1:Play();
        
        return compositionRatRunning1;
    end
    
    local createCompositionRatRunning2 = function()
    
        local compositionRatRunning2 = CreateCompositionSequence();
        local compositionDuration = 2.5;
        compositionRatRunning2:SetDuration(compositionDuration);
        
        -- Layer Rat_running
        local element = BuildRatRunningComposition();
        element:SetName("Rat_running_2");
        compositionRatRunning2:AddElement(element);
        element:SetHotSpot(512, 384);
        element:SetParentElement(compositionRatRunning2);
        element:SetScaleX(0.21);
        element:SetScaleY(0.21);
        element:SetAngle(0);
        element:SetOpacity(1);
    
        effector = element:GetEffector();
         effector:SetLifeTime(0, 5);
    
        effector:SetKey(_TRACK_X, 0, 1124.90515136719);
        effector:SetKey(_TRACK_Y, 0, 596.003326416016);
        effector:SetKey(_TRACK_X, 1.30000813802083, 491.133850097656);
        effector:SetKey(_TRACK_Y, 1.30000813802083, 811.844161987305);
    
        effector:Play();
        
        --compositionRatRunning2:Play();
        
        return compositionRatRunning2;
    end
    
    local composes = {};
    composes.ratRunning1 = createCompositionRatRunning1();
    --composes.ratRunning1:SetCyclic(true);
    composes.ratRunning1:SetZ(43);
    composes.ratRunning1:SetSpeed(0.8);
    composes.ratRunning1:AttachTo(play_field);
    composes.ratRunning1:SetDestroysOnEnd(false);
    composes.ratRunning1:SetEndAction("RatRunningEnded");
    RatRunningEnded(composes.ratRunning1);
    
    composes.ratRunning2 = createCompositionRatRunning2();
    --composes.ratRunning2:SetCyclic(true);
    composes.ratRunning2:SetZ(44);
    composes.ratRunning2:SetSpeed(0.8);
    composes.ratRunning2:AttachTo(play_field);
    composes.ratRunning2:SetDestroysOnEnd(false);
    composes.ratRunning2:SetEndAction("RatRunningEnded");
    RatRunningEnded(composes.ratRunning2);
    
    local compos = createComposition17_Theatre_Entrance_rat();
    compos:SetHotSpot(240.770385742188, 641.945083618164);
    compos:SetXY(410., 590.);
    compos:SetScaleX(0.5);
    compos:SetScaleY(0.5);
    compos:SetCyclic(true);
    compos:SetZ(45);
    compos:SetSpeed(0.8);
    compos:AttachTo(play_field);
    compos:SetCyclic(true);

end

function RatRunningEnded(compos)
    compos:PlayAt(math.random(5, 10));
end

function OnSceneFree(screen)
    DefaultOnSceneFree()
    FreeData(screen)
end

function OnUpdate(dt)
    DefaultOnUpdate(dt)

	if game_state.picked_object then
	    local v = GetMousePos() - clock_center
	    local obj = game_state.picked_object
        obj:SetAngle(obj.start_angle + v:Angle(nil) - obj.start_dangle)
    end

	if game_state.picked_object then
		SetCursor('CursorActive')
	end

	if HasGameState('ToolApplied', '08_rag') and
	   HasGameState('ToolFound', '08_stone')
	then
		game_state.ignore_on_highlight['area_hotell_street_evening'] = true
	end
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 GetTargetAngle(arrow)
    if arrow:GetName() == 'Arrow_1' then
        return 180. * M_PI / 180.
    end
    if arrow:GetName() == 'Arrow_2' then
        return 327. * M_PI / 180.
    end
end

function OnObjectMouseDown(object)
    local is_wrong_click = not DefaultOnObjectMouseDown(object)
    local obj_name = object:GetName()
    local pf = play_field

    if (obj_name == 'Arrow_1' and not game_state.arrow1_finished) or
       (obj_name == 'Arrow_2' and not game_state.arrow2_finished)
    then
        if HasGameState('ToolApplied', '08_rag') then
            game_state.picked_object = object
            local v = GetMousePos() - clock_center
            game_state.picked_object.start_angle = game_state.picked_object:GetAngle()
            game_state.picked_object.start_dangle = v:Angle(nil)
			game_state.picked_object.target_angle = GetTargetAngle(game_state.picked_object)
        else
            ShowMonolog('09_FindProperTime', 'C_09_FIND_PROPER_TIME')
        end
        
        play_field.rollClockArrowSound:StopSound();
        play_field.rollClockArrowSound:Play(false);

		is_wrong_click = false
    end

    DefaultOnObjectMouseDownProcessed(is_wrong_click);
end

function TestIfArrowInTargetAngle(arrow)
    local angle = arrow:GetAngle()
    angle = FixAngle(angle)
    if math.abs(GetTargetAngle(arrow) - angle) <= target_angle_delta then
		arrow:SetAngle(GetTargetAngle(arrow))
		play_field:IgnoreOnTestPoint(arrow:GetName())
		if arrow:GetName() == "Arrow_1" then
		    game_state.arrow1_finished = true
		end
		if arrow:GetName() == "Arrow_2" then
		    game_state.arrow2_finished = true
		end
		game_state.locked_objects[arrow:GetName()] = true
		if game_state.arrow1_finished and game_state.arrow2_finished then
		    AddGameState('TaskComplete', '09_clock')
            TimerDoString('HideZoomClock()', 1.7, play_field:GetTimer())
            PlaySound("Clock_opening_mechanism");
		    TimerDoString('OpenDoor()', 2.0, play_field:GetTimer())
		    play_field:GetObject('stick'):GetAnimation():Play()
		    play_field:GetObject('stick'):Move(0,-60,1.5)
		    play_field:GetObject('Zamok'):Move(0,-60,1.5)
		    --play_field:GetObject('stick'):GetAnimation():Stop()

		    UnregisterActiveObject('area_clock')
			zone_clock.Disable()
		end
	end
end

function OnObjectMouseUp(object)
    DefaultOnObjectMouseUp(object)

    if game_state.picked_object then
		SetGameState('09_arrow1_angle', tostring(play_field:GetObject('Arrow_1'):GetAngle()))
		SetGameState('09_arrow2_angle', tostring(play_field:GetObject('Arrow_2'):GetAngle()))
		TestIfArrowInTargetAngle(game_state.picked_object)
		game_state.picked_object = nil
    end
end

function HideZoomClock()
    zone_clock.SetVisible(false)
end

function OpenDoor()
    play_field:GetObject('Layer_Door_closed'):ChangeOpacity(1., 0., 0.3)
    play_field:GetObject('Layer_Door_mid'):ChangeOpacity(0., 1., 0.3)
    play_field:GetObject('Layer_Door_Opened_Light_Mid'):ChangeOpacity(0., 1., 0.3)

    TimerDoString("play_field:GetObject('Layer_Door_mid'):ChangeOpacity(1., 0., 0.3)", 0.3, play_field:GetTimer())
    TimerDoString("play_field:GetObject('Layer_Door_Opened'):ChangeOpacity(0., 1., 0.3)", 0.3, play_field:GetTimer())
    TimerDoString("play_field:GetObject('Layer_Door_Opened_Light_Mid'):ChangeOpacity(1., 0., 0.3)", 0.3, play_field:GetTimer())
    TimerDoString("play_field:GetObject('Layer_Door_Opened_Light_Final'):ChangeOpacity(0., 1., 0.3)", 0.3, play_field:GetTimer())

	TimerDoString("LinkHall()", 0.9, play_field:GetTimer())
	
    PlaySound("Door_opening");
end

function LinkHall()
	LinkScene('area_museum_hall1', 'CursorDoorLeft', 'data/Scenes/10_Museum_Hall_1_Main.lua', false)
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)

    local screen = level;
-- clouds 1
	local anim = screen:CreateAnimation('data/Texture/Scenes/Common/Clouds_blue.png');
	anim:SetPosXY(512, 130);
	anim:SetOpacity(.65);
	anim:SetScaleXY(2, 2);
	anim:SetPosZ(44);
	
	local effector = CreateTextureEffector();
	effector:AttachToAnimation(anim);
	effector:SetSpeed(-16);
	effector:Play();
	
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/09_Museum_Street/Layers/Layer_Door_closed.png',0,0,90,281,1,0)
	anim:SetHotSpot(45,140)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Door_closed',anim,105,423,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Layers/Layer_Door_mid.png',0,0,76,328,1,0)
	anim:SetHotSpot(38,164)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Door_mid',anim,92,425,90,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Layers/Layer_Door_Opened.png',0,0,47,334,1,0)
	anim:SetHotSpot(23,167)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Door_Opened',anim,81,418,80,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Door/Layers/Arrow_1.PNG',0,0,140,56,1,0)
	anim:SetHotSpot(24,19)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Arrow_1',anim,487,392,161,300,0.8,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Door/Layers/Arrow_2.PNG',0,0,180,50,1,0)
	anim:SetHotSpot(26,15)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Arrow_2',anim,487,393,160,270,0.65,0.65)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Door/Layers/Layer_Glass_Broken.PNG',0,0,201,194,1,0)
	anim:SetHotSpot(100,97)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Layer_Glass_Broken',anim,486,392,170,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Door/Layers/Layer_Glass_Mid1.PNG',0,0,221,217,1,0)
	anim:SetHotSpot(110,108)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Layer_Glass_Mid1',anim,483,392,176,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Door/Layers/Layer_Glass_Mid2.PNG',0,0,221,217,1,0)
	anim:SetHotSpot(110,108)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Layer_Glass_Mid2',anim,483,392,177,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Door/Layers/Layer_Glass.PNG',0,0,221,217,1,0)
	anim:SetHotSpot(110,108)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Layer_Glass',anim,483,392,175,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Door/Layers/Layer_Zamok_Perekrytie.PNG',0,0,40,58,1,0)
	anim:SetHotSpot(20,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Zamok_Perekrytie',anim,687,382,165,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_teatre_gate',anim,722,430,100,0,24,20)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_hotell_street_evening',anim,600,754,100,0,75,20)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_museum_hall1',anim,102,422,95,0,8,33)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Layers/Layer_Top.png',0,0,1024,355,1,0)
	anim:SetHotSpot(0,0)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Top',anim,0,0,45,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Layers/BG_Museum_Street.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Museum_Street',anim,512,384,40,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Layers/BG_Museum_Street.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(311,182)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Sky_BG',anim,311,184,42,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/Moon.PNG',0,0,340,320,1,0)
	anim:SetHotSpot(170,160)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Moon',anim,833,90,43,0,0.7,0.7)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Door/Layers/BG_Zoom_Door.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('BG_Zoom_Door',anim,512,384,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/06_Hotel_Street_Evening/Zone_Main/Layers/Layer_Light_L.png',0,0,168,193,1,0)
	anim:SetHotSpot(84,96)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Light_L',anim,394,307,90,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/06_Hotel_Street_Evening/Zone_Main/Layers/Layer_Light_R.png',0,0,117,118,1,0)
	anim:SetHotSpot(58,59)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Light_R',anim,846,282,90,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Door/Animations/stick.png',0,0,22,149,5,5)
	anim:SetHotSpot(11,0)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('stick',anim,686,292,160,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Door/Animations/Zamok.PNG',0,0,69,164,1,0)
	anim:SetHotSpot(34,82)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Zamok',anim,704,345,161,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Door/Layers/Layer_Zamok_Over.png',0,0,49,100,1,0)
	anim:SetHotSpot(24,50)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Zamok_Over',anim,723,387,165,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Layers/Layer_Door_Opened_Light_Mid.png',0,0,191,426,1,0)
	anim:SetHotSpot(95,213)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Door_Opened_Light_Mid',anim,161,422,85,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Layers/Layer_Door_Opened_Light_Final.png',0,0,191,426,1,0)
	anim:SetHotSpot(95,213)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Door_Opened_Light_Final',anim,160,424,87,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Layers/Layer_Poster.png',0,0,186,171,1,0)
	anim:SetHotSpot(93,85)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Zone_Poster',anim,276,618,50,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_poster',anim,308,603,51,0,12,16)
	local anim = CreateAnimation('data/Texture/Scenes/09_Museum_Street/Zoom_Poster/BG_Zoom_Poster.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('BG_Zoom_Poster',anim,512,384,161,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_window_right_1',anim,948,386,100,0,10,20)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_window_right_2',anim,980,140,100,0,9,15)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_clock',anim,481,386,101,0,40,40)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
