dofile('data/Scripts/scenes/06_garden/anim/06_garden_hp_anim_bg.lua')
dofile('data/Scripts/scenes/06_garden/anim/06_garden_hp_anim_valve.lua')
dofile('data/Scripts/scenes/06_garden/anim/06_garden_hp_anim_frog.lua')
dofile('data/Scripts/scenes/06_garden/anim/06_garden_hp_anim_butterfly.lua')
dofile('data/Scripts/scenes/06_garden/anim/06_garden_hp_anim_z_mill.lua')

class 'l_06_garden_hp' (LevelEventHandler)

function l_06_garden_hp:__init(name)
	LevelEventHandler.__init(self, name)
	
	-- animations ----------------------------------
	self.anim_bg = AnimationBundle(Loader_06_HP_BG_Animations(Object('bg')))
	self.anim_bg:PlayAnimation('water_move')
	self.anim_bg:GetAnimation('small_wheel_move'    ):SetVisible(true)
	self.anim_bg:GetAnimation('vavle_compos'        ):SetVisible(true)
	self.anim_bg:GetAnimation('big_wheel_move_cycle'):SetVisible(true)
	
	self.anim_frog = AnimationBundle(Loader_06_Frog_Animations(Object('bg')))
	self.anim_frog:GetAnimation('frog_jump_back'):SetVisible(true)
	
	self.anim_butterfly = AnimationBundle(Loader_06_HP_Butterfly_Animations(Object('bg')))
	---
	
	self.anim_valve = AnimationBundle(Loader_06_HP_Valve_Animations(Object('bg')))
	---
	
	do
        self.video_water_back = CreateVideoEntity('data/Video/Scenes/06_garden_hp/06_hp_water_back.ogg', '', false)
        self.video_water_back:AttachTo(Object('bg'))
        self.video_water_back:SetZ(1)
        self.video_water_back:SetXY(57 - 512, 158 - 384)
        self.video_water_back:SetLoop(true)
        self.video_water_back:PlayVideo()
	end
	
	-- link scenes ---------------------------------
	
	-- zoom zones ----------------------------------
	
	-- main logic ----------------------------------
	DefineToolFindOrder('06_hammer_handle', '06_wave')
	
	-- ZOOM VALVE
	do
	    CreateSmartZoomZone('valve')
	    ---------------------
	end
	
	-- ZOOM MILL
	do
	    CreateSmartZoomZone('mill')
	    ---------------------
	    
        local x,y,w,h = self.zoom_mill:GetClippingInfo()
        Object('z_mill_shovel_handle'):SetClippingRect(x,y,w,h)
        ---------------------
        
        self.anim_mill = AnimationBundle(Loader_06_HP_Zoom_mill_Animations(Object('z_mill_bg')))
        ---------------------
    end
	
	-- ZOOM WEB
	do
	    local zoom, zoneObject = CreateSmartZoomZone('web')
	    self.webZoneObject = zoneObject
	    ---------------------
	    
	    do
            local x,y,w,h = self.zoom_web:GetClippingInfo()
            self.zoom_web.anim:GetAnimation('fly'):SetClippingRect(x,y,w,h)
        end
        ---------------------
        
        self.zoom_web.on_open = function()
            if self.webZoneObject.sound_fly_idle then
                self.webZoneObject.sound_fly_idle:SetVolume(1)
            end
            
            if HasActionCompletedState('SpiderPlaced') and not HasActionCompletedState('webMMGCompleted') then
                self:GetPanelLuaObject():SetMode( EPanelMode.PM_MINIGAME )
            end
        end
        ---------------------
        
        self.zoom_web.on_close = function()
            if self.webZoneObject.sound_fly_idle then
                self.webZoneObject.sound_fly_idle:SetVolume(0)
            end
            
            self:GetPanelLuaObject():SetMode( EPanelMode.PM_HIDDENPICTURE )
        end
        ---------------------
    end
	
    -- ZOOM FROG
    do
	    CreateSmartZoomZone('frog')
	    ---------------------
	    
	    self.zoom_frog.on_open = function()
	        if not HasActionCompletedState('frogMMGCompleted') then
                self:GetPanelLuaObject():SetMode( EPanelMode.PM_MINIGAME )
            end
	    end
	    ---------------------
	    
	    self.zoom_frog.on_close = function()
            self:GetPanelLuaObject():SetMode( EPanelMode.PM_HIDDENPICTURE )
        end
        ---------------------
	end
	
	-- ZOOM RAKE
	do
	    CreateSmartZoomZone('rake')
	    ---------------------
	    
	    self.zoom_rake.on_open = function()
	        if InteractiveHelp.IsActive() and not InteractiveHelp.IsTipShown('FROG_DROP') and self.rake_handle_founded then
                DropDragingObject(nil, 0)
                InteractiveHelp.ShowTip('FROG_DROP')
            end
	    end
	    ---------------------
	end
	
	self:generateTasks_deal1()
	self:generateTasks_deal2()
end
-------------------------------------------------------------------------------

function l_06_garden_hp:generateTasks_deal1()
    do
        ObjectOpacity('layer_rake',            0)
        ObjectOpacity('layer_left_leaf_open',  0)
        ObjectOpacity('layer_right_leaf_open', 0)
        ObjectOpacity('layer_sand_valve_3',    0)
        
        ObjectOpacity('z_mill_wheel_peg_1', 0)
        ObjectOpacity('z_mill_wheel_peg_2', 0)
        
        ObjectOpacity('z_rake_handle', 0)
        
        ObjectOpacity('z_valve_valve',   0)
        ObjectOpacity('z_valve_valve_2', 0)
    end
    -------------------------
    
    do
        ObjectVisible('area_find_peg_1',            false)
        ObjectVisible('area_click_right_leaf',      false)
        ObjectVisible('area_click_stone',           false)
        ObjectVisible('area_drop_pegs',             false)
        ObjectVisible('area_find_valve',            false)
        ObjectVisible('area_find_spider',           false)
        ObjectVisible('area_click_zv_valve',        false)
        ObjectVisible('area_hint_zv_valve',         false)
        ObjectVisible('area_find_zv_hammer_hendle', false)
        ObjectVisible('area_find_peg_2',            false)
        
        ObjectVisible('area_zoom_rake',    false)
        ObjectVisible('area_find_zr_rake', false)
    end
    -------------------------
    
    self.webZoneObject:setLinksVisible(self.webZoneObject.spiderPos, false)
    ObjectOpacity('z_web_spider', 0)
    -------------------------
	
	local function on_click_left_leaf(e)
	    ObjectVisible(e.target, false)
	    
	    if e.save then
	        ObjectOpacity('layer_left_leaf_close', 0)
	        ObjectOpacity('layer_left_leaf_open',  1)
	        ObjectVisible('area_find_peg_1', true)
	        
	        InteractiveHelp.ShowTip('FROG_FIND')
	    else
	        local time = 0.5
	        ObjectOpacity('layer_left_leaf_close', 0, time)
	        ObjectOpacity('layer_left_leaf_open',  1, time)
	        
	        self.sound_click_leaf = MakeSoundEntity('06_hp_click_leaf')
	        self.sound_click_leaf:PlaySound(false)
	        
	        self.timer:Add( function()
	                            ObjectVisible('area_find_peg_1', true)
	                            InteractiveHelp.ShowTip('FROG_FIND')
	                        end,
	                        time)
	    end
	end
	-------------------------
	
	local function on_click_right_leaf(e)
	    ObjectVisible(e.target, false)
	    
	    if e.save then
	        ObjectOpacity('layer_right_leaf_close', 0)
	        ObjectOpacity('layer_right_leaf_open',  1)
	        ObjectVisible('area_click_stone', true)
	    else
	        local time = 0.5
	        ObjectOpacity('layer_right_leaf_close', 0, time)
	        ObjectOpacity('layer_right_leaf_open',  1, time)
	        
	        if not self.sound_click_leaf then
	            self.sound_click_leaf = MakeSoundEntity('06_hp_click_leaf')
	        end
	        self.sound_click_leaf:PlaySound(false)
	        
	        self.timer:Add( function()
	                            ObjectVisible('area_click_stone', true)
	                        end,
	                        time)
	    end
	end
	-------------------------
	
	local function on_click_stone(e)
	    ObjectVisible(e.target, false)
	    
	    local deltaX = 120
	    
	    if e.save then
	        Object('layer_stone'):SetX(Object('layer_stone'):GetX() + deltaX)
	        ObjectVisible('area_zoom_rake', true)
	    else
	        local time = 0.5
	        Object('layer_stone'):Move(deltaX, 0, time)
	        
	        MakeSoundEntity('06_hp_click_stone'):PlaySound(false)
	        
	        self.timer:Add( function()
	                            ObjectVisible('area_zoom_rake', true)
	                        end,
	                        time)
	    end
	end
	-------------------------
	
	local function on_find_rake_handle(e)
	    self.rake_handle_founded = true
	    
	    ObjectVisible('area_find_zv_rake_handle', false)
	    
	    if e.save then
	        ObjectOpacity('layer_rake_handle',   0)
	        ObjectOpacity('z_valve_rake_handle', 0)
	    else
	        local time = 0.1
	        ObjectOpacity('layer_rake_handle',   0, time)
	        ObjectOpacity('z_valve_rake_handle', 0, time)
	    end
	end
	-------------------------
    
    local function on_drop_rake_handle(e)
        ObjectVisible(e.info.targetObjectName, false)
        
        if e.save then
            ObjectOpacity('layer_rake_part', 0)
            ObjectOpacity('layer_rake',      1)
            ObjectOpacity('z_rake_handle',   1)
            ObjectVisible('area_find_zr_rake', true)
        else
            local time = 0.5
            ObjectOpacity('layer_rake_part', 0, time)
            ObjectOpacity('layer_rake',      1, time)
            ObjectOpacity('z_rake_handle',   1, time)
            
            MakeSoundEntity('06_hp_drop_rake_handle'):PlaySound(false)
            
            self.timer:Add( function()
                                ObjectVisible('area_find_zr_rake', true)
                            end,
                            time)
        end
    end
    -------------------------
    
    local function on_find_rake(e)
        self.rake_founded = true
        
        if e.save then
            ObjectOpacity('z_rake_handle', 0)
            ObjectOpacity('z_rake_item',   0)
            self.zoom_rake:CloseAndDisable()
        else
            local time = 0.1
            ObjectOpacity('z_rake_handle', 0, time)
            ObjectOpacity('z_rake_item',   0, time)
            
            self.mouseBlocker:Push()
            self.timer:Add( function()
                                self.mouseBlocker:Pop()
                                self.zoom_rake:CloseAndDisable()
                            end,
                            time)
        end
        
        ObjectOpacity('layer_rake', 0)
    end
    -------------------------
    
    local function on_drop_rake(e)
        ObjectVisible(e.info.targetObjectName, false)
        
        if e.save then
            ObjectOpacity('z_mill_ivy', 0)
            ObjectOpacity('layer_ivy',  0)
            
            ObjectVisible('area_drop_pegs',   true)
            ObjectVisible('area_find_valve',  true)
            ObjectVisible('area_find_spider', true)
        else
            local time = 0.5
            ObjectOpacity('z_mill_ivy', 0, time)
            ObjectOpacity('layer_ivy',  0, time)
            
            MakeSoundEntity('06_hp_drop_rake'):PlaySound(false)
            
            self.timer:Add( function()
                                ObjectVisible('area_drop_pegs',   true)
                                ObjectVisible('area_find_valve',  true)
                                ObjectVisible('area_find_spider', true)
                            end,
                            time)
        end
    end
    -------------------------
    
    local function on_find_peg_1(e)
        ObjectOpacity('layer_peg_on_leaf', 0)
        ObjectVisible('area_click_right_leaf', true)
    end
    -------------------------
    
    local function o_all_pegs_dropped(save)
        if not HasActionCompletedState('water') then
            AddActionCompletedState('water')
        end
        
        ObjectOpacity('z_mill_wheel_1',     0)
        ObjectOpacity('z_mill_wheel_peg_1', 0)
        ObjectOpacity('z_mill_wheel_peg_2', 0)
        ObjectOpacity('z_mill_axle_1',      0)
        
        self.anim_mill:PlayAnimation('mill')
        
        self.video_water_back = CreateVideoEntity('data/Video/Scenes/06_garden_hp/06_hp_water_wheel.ogg', '', true)
        self.video_water_back:AttachTo(Object('bg'))
        self.video_water_back:SetZ(4)
        self.video_water_back:SetXY(692-512, 307-384)
        self.video_water_back:SetLoop(true)
        
        self.sound_wheel_loop = MakeSoundEntity('06_hp_wheel_loop')
        self.sound_wheel_loop:PlaySound(true)
        
        if save then
            ObjectOpacity('layer_mill_without_pegs', 0)
            
            if HasActionCompletedState('valve_dropped') then
                ObjectVisible('area_hint_zv_valve',  false)
                ObjectVisible('area_click_zv_valve', true)
            end
            
            self.anim_bg:PlayAnimation('big_wheel_move_cycle')
            self.anim_bg:PlayAnimation('small_wheel_move')
            self.anim_bg:PlayAnimation('water_on_cube')
            self.anim_bg:PlayAnimation('right_tube_water_cycle_correct')
            self.video_water_back:PlayVideo()
        else
            local time = 0.5
            ObjectOpacity('layer_mill_without_pegs', 0, time)
            
            self.mouseBlocker:Push()
            self.timer:Add( function()
                                self.zoom_mill:Close()
                                
                                self.anim_bg:PlayAnimation('big_wheel_move_cycle')
                                self.anim_bg:PlayAnimation('small_wheel_move')
                                self.video_water_back:PlayVideo()
                                self.video_water_back:ChangeOpacity(0, 1, 0.5)
                                
                                self.timer:Add( function()
                                                    self.anim_bg:PlayAnimation('water_on_cube')
                                                    self.anim_bg:GetAnimation('water_on_cube'):ChangeOpacity(0,1,0.5)
                                                    
                                                    self.timer:Add( function()
                                                                        self.anim_bg:PlayAnimation('right_tube_water_enter_correct')
                                                                        
                                                                        self.timer:Add( function()
                                                                                            self.anim_bg:StopAnimation('right_tube_water_enter_correct')
                                                                                            self.anim_bg:PlayAnimation('right_tube_water_cycle_correct')
                                                                                            
                                                                                            self.mouseBlocker:Pop()
                                                                                            
                                                                                            if HasActionCompletedState('valve_dropped') then
                                                                                                ObjectVisible('area_hint_zv_valve',  false)
                                                                                                ObjectVisible('area_click_zv_valve', true)
                                                                                            end
                                                                                        end,
                                                                                        self.anim_bg:GetAnimation('right_tube_water_enter_correct'):GetDuration())
                                                                    end,
                                                                    0.5)
                                                end,
                                                0.5)
                            end,
                            time)
        end
    end
    -------------------------
    
    self.pegs_dropped = 0
    
    local function on_drop_peg(e)
        self.pegs_dropped = self.pegs_dropped + 1
        
        if e.save then
            ObjectOpacity('z_mill_wheel_'..e.info.objectName, 1)
            
            if self.pegs_dropped == 2 then
                ObjectVisible(e.info.targetObjectName, false)
                o_all_pegs_dropped(true)
            else
                play_field:DoNotIgnoreOnTestPoint(e.info.targetObjectName)
            end
        else
            local time = 0.5
            ObjectOpacity('z_mill_wheel_'..e.info.objectName, 1, time)
            
            if not self.sound_drop_peg then
                self.sound_drop_peg = MakeSoundEntity('06_hp_drop_peg')
            end
            self.sound_drop_peg:StopSound()
            self.sound_drop_peg:PlaySound(false)
            
            if self.pegs_dropped == 2 then
                ObjectVisible(e.info.targetObjectName, false)
                
                self.mouseBlocker:Push()
                self.timer:Add( function()
                                    self.mouseBlocker:Pop()
                                    o_all_pegs_dropped(false)
                                end,
                                time)
            else
                play_field:DoNotIgnoreOnTestPoint(e.info.targetObjectName)
            end
        end
    end
    -------------------------
    
    local function on_find_spider(e)
        ObjectOpacity('z_mill_spider', 0)
    end
    -------------------------
    
    local function on_drop_spider(e)
        ObjectVisible(e.info.targetObjectName, false)
        
        if e.save then
            self.webZoneObject:setLinksVisible(self.webZoneObject.spiderPos, true)
            self.webZoneObject.reset:Show()
            
            ObjectOpacity('z_web_spider', 1)
        else
            local time = 0.5
            ObjectOpacity('z_web_spider', 1, time)
            AddActionCompletedState('SpiderPlaced')
            
            self.timer:Add( function()
                                self.webZoneObject:setLinksVisible(self.webZoneObject.spiderPos, true)
                                self.webZoneObject.reset:Show()
                                self:GetPanelLuaObject():SetMode( EPanelMode.PM_MINIGAME )
                            end,
                            time)
        end
    end
    -------------------------
    
    local function on_find_valve(e)
        ObjectOpacity('z_mill_valve', 0)
    end
    -------------------------
    
    local function on_drop_valve(e)
        ObjectVisible(e.info.targetObjectName, false)
        
        if HasActionCompletedState('water') then
            ObjectVisible('area_click_zv_valve', true)
        else
            ObjectVisible('area_hint_zv_valve', true)
        end
        
        if e.save then
            ObjectOpacity('z_valve_valve', 1)
            self.anim_valve:GetAnimation('valve'):SetVisible(true)
        else
            AddActionCompletedState('valve_dropped')
            
            local time = 0.5
            ObjectOpacity('z_valve_valve', 1, time)
            self.anim_valve:GetAnimation('valve'):SetVisible(true)
            MakeSoundEntity('06_hp_drop_valve'):PlaySound(false)
        end
    end
    -------------------------
    
    local function on_find_fly(e)
        self.zoom_web:CloseAndDisable()
    end
    -------------------------
    
    local function on_drop_fly(e)
        ObjectVisible(e.info.targetObjectName, false)
        
        local compos = self.anim_frog:GetAnimation('frog_jump_back')
        
        if e.save then
            compos:SetVisible(false)
            ObjectVisible('area_find_peg_2', true)
        else
            compos:Play()
            MakeSoundEntity('06_hp_drop_fly'):PlaySound(false)
            
            self.timer:Add( function()
                                ObjectVisible('area_find_peg_2', true)
                            end,
                            0.5) --compos:GetDuration())
        end
    end
    -------------------------
    
    local function on_find_peg_2(e)
        ObjectOpacity('layer_peg_2', 0)
        self.zoom_web:CloseAndDisable()
    end
    -------------------------
    
    local function on_click_valve(e)
        self.valve_clicked = true
        
        ObjectVisible(e.target, false)
        local composValve = self.anim_valve:GetAnimation('valve')
        local compos      = self.anim_bg:GetAnimation('vavle_compos')
        
        if e.save then
            compos:Rewind(true)
            composValve:Rewind(true)
            
            ObjectVisible('area_find_zv_hammer_hendle', true)
        else
            compos:Play()
            composValve:Play()
            
            local valveRotateTime = 0.5
            MakeSoundEntity('06_hp_click_valve'):PlaySound(false)
            
            ObjectOpacity('z_valve_valve',   0, valveRotateTime)
            ObjectOpacity('z_valve_valve_2', 1, valveRotateTime)
            
            self.mouseBlocker:Push()
            self.timer:Add( function()
                                self.video_ground:PlayVideo()
                                
                                self.timer:Add( function()
                                                    ObjectOpacity('z_valve_valve',   1, valveRotateTime)
                                                    ObjectOpacity('z_valve_valve_2', 0, valveRotateTime)
                                                    
                                                    self.timer:Add( function()
                                                                        self.mouseBlocker:Pop()
                                                                        ObjectVisible('area_find_zv_hammer_hendle', true)
                                                                    end,
                                                                    valveRotateTime)
                                                end,
                                                self.video_ground:GetDuration() - valveRotateTime)
                            end,
                            valveRotateTime)
        end
    end
    -------------------------
    
    local function on_find_hammer_handle(e)
        local compos = self.anim_bg:GetAnimation('vavle_compos')
        compos:GetElementByName('Layer_4'):SetOpacity(0)
        
        if e.save then
            ObjectOpacity('z_valve_hammer_handle', 0)
        else
            local time = 0.2
            ObjectOpacity('z_valve_hammer_handle', 0, time)
            
            self.timer:Add( function()
                                self.zoom_valve:Close()
                            end,
                            time)
        end
    end
    -------------------------
    
    InteractiveHelp.ShowTip('FROG_ACTION')
    
    RegisterActiveObject('area_click_left_leaf',  on_click_left_leaf)
    RegisterMonologObject('area_hint_zv_valve', 'BBT_06_NO_WATER')
    RegisterTaskHP(1, 'peg_1',       'area_find_peg_1',   'area_drop_pegs',        on_drop_peg,         on_find_peg_1,  nil)
    RegisterActiveObject('area_click_right_leaf', on_click_right_leaf)
    RegisterActiveObject('area_click_stone',      on_click_stone)
    RegisterTaskHP(1, 'rake_handle', 'area_find_zv_rake_handle', 'area_drop_zr_rake_handle', on_drop_rake_handle, on_find_rake_handle)
    RegisterTaskHP(1, 'rake',        'area_find_zr_rake',        'area_drop_rake',        on_drop_rake,        on_find_rake)
    RegisterTaskHP(1, 'spider',      'area_find_spider',         'area_drop_spider',      on_drop_spider,      on_find_spider)
    RegisterTaskHP(1, 'fly',         'area_find_fly',            'area_drop_fly',         on_drop_fly,         on_find_fly)
    RegisterTaskHP(1, 'valve',       'area_find_valve',          'area_drop_zv_valve',    on_drop_valve,       on_find_valve)
    RegisterTaskHP(1, 'peg_2',       'area_find_peg_2',          'area_drop_pegs',        on_drop_peg,         on_find_peg_2)
    RegisterActiveObject('area_click_zv_valve', on_click_valve)
    RegisterTaskHP(1, 'hammer_handle', 'area_find_zv_hammer_hendle',   nil, nil, on_find_hammer_handle)
    
    if not self.valve_clicked then
        self.video_ground = CreateVideoEntity('data/Video/Scenes/06_garden_hp/06_hp_ground.ogg', '', true)
        self.video_ground:AttachTo(Object('z_valve_bg'))
        self.video_ground:SetZ(10)
        self.video_ground:SetXY(31, 50)
        self.video_ground:SetLoop(false)
        self.video_ground:SetHideOnStop(true)
        self.video_ground:SetOnFirstFrame()
    end
end

function l_06_garden_hp:generateTasks_deal2()
    if self:GetAdditionalLogic().dealIndex == 1 then
        ObjectVisible('area_click_stone2',       false)
        ObjectVisible('area_drop_zv_jug',        false)
        ObjectVisible('area_click_zv_valve2',    false)
        ObjectVisible('area_hint_zv_valve2',     false)
        ObjectVisible('area_find_shovel_handle', false)
        ObjectVisible('area_drop_shovel_handle', false)
        ObjectVisible('area_drop_shovel',        false)
        ObjectVisible('area_find_flower',        false)
    else
        --self.anim_bg:PlayAnimation('frog_idle_2')
        
        self.anim_bg:StopAnimation('vavle_compos')
        self.anim_valve:StopAnimation('valve')
        
        self.anim_bg:GetAnimation('vavle_2_compos'):SetVisible(true)
        self.anim_valve:GetAnimation('valve2'):SetVisible(true)
    end
    -------------------------
    
    
    do
        ObjectVisible('area_find_jug',               false)
        ObjectVisible('area_click_zv_valve2',        false)
        ObjectVisible('area_find_zv_jug_with_water', false)
        ObjectVisible('area_find_shovel',            false)
        ObjectVisible('area_drop_flower',            false)
        ObjectVisible('area_drop_jug_with_water',    false)
        ObjectVisible('area_zoom_frog',              false)
    end
    
    do
        ObjectOpacity('layer_jug_dropped',    0)
        ObjectOpacity('layer_hole',           0)
        ObjectOpacity('layer_gnome_face',     0)
        ObjectOpacity('z_mill_shovel_handle', 0)
        
        ObjectOpacity('z_valve_jug',          0)
        ObjectOpacity('z_valve_water_in_jug', 0)
        
        Object('anim_flower'):GetAnimation():SetMode(0)
        Object('anim_flower'):GetAnimation():Stop()
        Object('anim_flower'):SetOpacity(0)
    end
    -------------------------
    
    local function on_click_stone(e)
        ObjectVisible(e.target, false)
        
        local deltaX = -120
        
        if e.save then
            Object('layer_stone'):SetX(Object('layer_stone'):GetX() + deltaX)
            ObjectVisible('area_find_jug', true)
        else
            local time = 0.5
            Object('layer_stone'):Move(deltaX, 0, time)
            
            MakeSoundEntity('06_hp_click_stone'):PlaySound(false)
            
            self.timer:Add( function()
                                ObjectVisible('area_find_jug', true)
                            end,
                            time)
        end
    end
    -------------------------
    
    local function on_find_jug(e)
        ObjectVisible(e.info.getObjectName, false)
        ObjectOpacity('layer_jug', 0)
    end
    -------------------------
    
    local function on_drop_jug(e)
        ObjectVisible(e.info.targetObjectName, false)
        ObjectVisible('area_hint_zv_valve2', false)
        
        if e.save then
            ObjectOpacity('layer_jug_dropped', 1)
            ObjectOpacity('z_valve_jug', 1)
            
            ObjectVisible('area_click_zv_valve2', true)
        else
            local time = 0.5
            ObjectOpacity('layer_jug_dropped', 1, time)
            ObjectOpacity('z_valve_jug', 1, time)
            
            MakeSoundEntity('06_hp_drop_jug'):PlaySound(false)
            
            self.timer:Add( function()
                                ObjectVisible('area_click_zv_valve2', true)
                            end,
                            time)
        end
    end
    -------------------------
    
    local function on_click_valve(e)
        ObjectVisible(e.target, false)
        local compos = self.anim_bg:GetAnimation('vavle_2_compos')
        local composValve = self.anim_valve:GetAnimation('valve2')
        
        if e.save then
            ObjectOpacity('z_valve_water_in_jug', 1)
            ObjectVisible('area_find_zv_jug_with_water', true)
        else
            local time = compos:GetDuration()
            
            compos:Play()
            composValve:Play()
            
            local valveRotateTime = 0.5
            MakeSoundEntity('06_hp_click_valve'):PlaySound(false)
            
            ObjectOpacity('z_valve_valve',   0, valveRotateTime)
            ObjectOpacity('z_valve_valve_2', 1, valveRotateTime)
            
            self.mouseBlocker:Push()
            self.timer:Add( function()
                                self.video_water_in_jug = CreateVideoEntity('data/Video/Scenes/06_garden_hp/06_hp_water_in_jug.ogg', '', false)
                                self.video_water_in_jug:AttachTo(Object('z_valve_bg'))
                                self.video_water_in_jug:SetZ(21)
                                self.video_water_in_jug:SetXY(13, 11)
                                self.video_water_in_jug:SetLoop(false)
                                self.video_water_in_jug:SetHideOnStop(false)
                                self.video_water_in_jug:PlayVideo()
                                
                                local time = self.video_water_in_jug:GetDuration()
                                
                                self.timer:Add( function()
                                                    ObjectOpacity('z_valve_valve',   1, valveRotateTime)
                                                    ObjectOpacity('z_valve_valve_2', 0, valveRotateTime)
                                                end,
                                                time - valveRotateTime)
                                
                                self.timer:Add( function()
                                                    self.video_water_in_jug:SetHideOnStop(true)
                                                    self.video_water_in_jug:StopVideo()
                                                    
                                                    ObjectOpacity('z_valve_water_in_jug', 1)
                                                    ObjectVisible('area_find_zv_jug_with_water', true)
                                                    
                                                    self.mouseBlocker:Pop()
                                                end,
                                                time)
                            end,
                            valveRotateTime)
        end
    end
    -------------------------
    
    local function on_find_jug_with_water(e)
        ObjectVisible(e.info.getObjectName, false)
        
        if e.save then
            ObjectOpacity('z_valve_water_in_jug', 0)
            ObjectOpacity('z_valve_jug',          0)
            ObjectOpacity('layer_jug_dropped',    0)
            
            self.zoom_valve:CloseAndDisable()
        else
            local time = 0.2
            ObjectOpacity('z_valve_water_in_jug', 0, time)
            ObjectOpacity('z_valve_jug',          0, time)
            ObjectOpacity('layer_jug_dropped',    0, time)
            
            self.timer:Add( function()
                                self.zoom_valve:CloseAndDisable()
                            end,
                            time)
        end
    end
    -------------------------
    
    local function on_find_shovel_handle(e)
        ObjectVisible(e.info.getObjectName, false)
        ObjectOpacity('layer_shovel_handle', 0)
    end
    -------------------------
    
    local function on_drop_shovel_handle(e)
        ObjectVisible(e.info.targetObjectName, false)
        
        if e.save then
            ObjectOpacity('z_mill_shovel_handle', 1)
            ObjectVisible('area_find_shovel', true)
        else
            local time = 0.5
            ObjectOpacity('z_mill_shovel_handle', 1, time)
            MakeSoundEntity('06_hp_drop_shovel_handle'):PlaySound(false)
            
            self.timer:Add( function()
                                ObjectVisible('area_find_shovel', true)
                            end,
                            time)
        end
    end
    -------------------------
    
    local function on_find_shovel(e)
        ObjectVisible(e.info.getObjectName, false)
        ObjectOpacity('z_mill_shovel',        0)
        ObjectOpacity('z_mill_shovel_handle', 0)
        ObjectOpacity('layer_shovel',         0)
        
        self.zoom_mill:CloseAndDisable()
    end
    -------------------------
    
    local function on_drop_shovel(e)
        ObjectVisible(e.info.targetObjectName, false)
        
        if e.save then
            ObjectOpacity('layer_hole', 1)
            ObjectVisible('area_drop_flower', true)
        else
            local time = 0.5
            ObjectOpacity('layer_hole', 1, time)
            MakeSoundEntity('06_hp_drop_shovel'):PlaySound(false)
            
            self.timer:Add( function()
                                ObjectVisible('area_drop_flower', true)
                            end,
                            time)
        end
    end
    -------------------------
    
    local function on_find_flower(e)
        ObjectVisible(e.info.getObjectName, false)
        ObjectOpacity('layer_flower1', 0)
    end
    -------------------------
    
    local function on_drop_flower(e)
        ObjectVisible(e.info.targetObjectName, false)
        
        if e.save then
            Object('anim_flower'):SetOpacity(1)
            ObjectOpacity('layer_hole',    0)
            ObjectOpacity('layer_gnome_face', 1, time)
            ObjectVisible('area_drop_jug_with_water', true)
        else
            local time = 0.5
            ObjectOpacity('anim_flower', 1, time)
            ObjectOpacity('layer_hole',  0, time)
            ObjectOpacity('layer_gnome_face', 1, time)
            
            MakeSoundEntity('06_hp_drop_flower'):PlaySound(false)
            
            self.timer:Add( function()
                                ObjectVisible('area_drop_jug_with_water', true)
                            end,
                            time)
        end
    end
    -------------------------
    
    local function on_drop_jug_with_water(e)
        ObjectVisible(e.info.targetObjectName, false)
        
        if e.save then  
            Object('anim_flower'):GetAnimation():Rewind(true)
            --self.anim_bg:GetAnimation('butterfly'):Rewind(true)
            --self.anim_bg:GetAnimation('frog_jump_2'):Rewind(true)
            --self.anim_bg:GetAnimation('frog_jump_2'):SetVisible(true)
            
            --self.anim_bg:StopAnimation('frog_idle_2')
            self.anim_butterfly:PlayAnimation('idle')
            
            ObjectVisible('area_zoom_frog', true)
        else
            local time = GetAnimationLength(Object('anim_flower'):GetAnimation())
            Object('anim_flower'):GetAnimation():Play()
            MakeSoundEntity('06_hp_drop_jug_with_water'):PlaySound(false)
            
            self.mouseBlocker:Push()
            self.timer:Add( function()
                                --self.anim_bg:PlayAnimation('butterfly')
                                self.anim_butterfly:PlayAnimation('action')
                                
                                self.timer:Add( function()
                                                    MakeSoundEntity('06_hp_drop_fly'):PlaySound(false)
                                                end,
                                                self.anim_butterfly:GetAnimation('action'):GetDuration() * 0.6)
                                
                                self.timer:Add( function()
                                                    self.mouseBlocker:Pop()
                                                    --self.anim_bg:StopAnimation('frog_idle_2')
                                                    --self.anim_bg:PlayAnimation('frog_jump_2')
                                                    
                                                    self.anim_butterfly:StopAnimation('action')
                                                    self.anim_butterfly:PlayAnimation('idle')
                                                end,
                                                self.anim_butterfly:GetAnimation('action'):GetDuration())
                                                --self.anim_bg:GetAnimation('butterfly'):GetDuration())
                                
                                ObjectVisible('area_zoom_frog', true)
                            end,
                            time)
        end
    end
    -------------------------
    
    local function on_find_wave(e)
        ObjectVisible(e.info.getObjectName, false)
        ObjectOpacity('z_frog_wave', 0)
    end
    -------------------------
    
    RegisterActiveObject('area_click_stone2', on_click_stone)
    RegisterMonologObject('area_hint_zv_valve2', 'BBT_06HP_NO_JUG')
    RegisterTaskHP(2, 'jug', 'area_find_jug', 'area_drop_zv_jug', on_drop_jug, on_find_jug)
    RegisterActiveObject('area_click_zv_valve2', on_click_valve)
    RegisterTaskHP(2, 'jug_with_water', 'area_find_zv_jug_with_water', 'area_drop_jug_with_water', on_drop_jug_with_water, on_find_jug_with_water, nil)
    RegisterTaskHP(2, 'shovel_handle',  'area_find_shovel_handle',  'area_drop_shovel_handle',  on_drop_shovel_handle,  on_find_shovel_handle)
    RegisterTaskHP(2, 'shovel',         'area_find_shovel',         'area_drop_shovel',         on_drop_shovel,         on_find_shovel)
    RegisterTaskHP(2, 'flower',         'area_find_flower',         'area_drop_flower',         on_drop_flower,         on_find_flower)
    RegisterTaskHP(2, 'wave',           'area_find_wave',           nil,                        nil,                    on_find_wave)
end

function l_06_garden_hp:OnUpdate(dt)
end

function l_06_garden_hp:OnAllItemsFound()
end

function l_06_garden_hp:OnObjectMouseEnter(object)
end

function l_06_garden_hp:OnObjectMouseLeave(object)
end

function l_06_garden_hp:OnScreenObjectMouseDown(object, key)
end

function l_06_garden_hp:OnObjectMouseDownProcessed(is_wrong_click)
end

function l_06_garden_hp:OnMouseMove(previous_pos, current_pos)
end

function l_06_garden_hp:OnObjectMouseUp(object)
end

function l_06_garden_hp:OnObjectFound(object)
end

function l_06_garden_hp:OnToolFound(tool)
end

function l_06_garden_hp:OnToolApply(tool, object)
end

function l_06_garden_hp:OnToolAddToInventory(tool)
end

function l_06_garden_hp:OnObjectReachPanel(object)
end

function l_06_garden_hp:OnButtonPress(title)
end

function l_06_garden_hp:OnSetTool(tool)
end

function l_06_garden_hp:OnLoaded()
end

function l_06_garden_hp:OnDestroy()
end

--------------------------------------------------------------------------------
-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function l_06_garden_hp:LoadData(screen)
	local anim
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/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,50,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/rake_handle.png',0,0,125,125,1,0)
	anim:SetHotSpot(62,62)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('rake_handle',anim,263,88,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/peg_1.png',0,0,64,64,1,0)
	anim:SetHotSpot(32,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('peg_1',anim,240,57,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/peg_2.png',0,0,64,64,1,0)
	anim:SetHotSpot(32,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('peg_2',anim,235,66,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/rake.png',0,0,125,125,1,0)
	anim:SetHotSpot(62,62)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('rake',anim,240,62,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/valve.png',0,0,64,64,1,0)
	anim:SetHotSpot(32,32)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('valve',anim,224,86,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/spider.png',0,0,80,68,1,0)
	anim:SetHotSpot(40,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('spider',anim,267,80,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/hammer_handle.png',0,0,120,45,1,0)
	anim:SetHotSpot(60,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('hammer_handle',anim,258,52,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_rake.png',0,0,150,52,1,0)
	anim:SetHotSpot(75,26)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_rake',anim,164,608,52,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_rake_handle.png',0,0,57,69,1,0)
	anim:SetHotSpot(28,34)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_rake_handle',anim,553,521,56,0,0.7,0.7)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_rake_part.png',0,0,86,48,1,0)
	anim:SetHotSpot(43,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_rake_part',anim,184,618,51,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_left_leaf_close.png',0,0,182,180,1,0)
	anim:SetHotSpot(91,90)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_left_leaf_close',anim,189,581,62,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_left_leaf_open.png',0,0,172,200,1,0)
	anim:SetHotSpot(86,100)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_left_leaf_open',anim,86,562,63,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_right_leaf_close.png',0,0,148,152,1,0)
	anim:SetHotSpot(23,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_right_leaf_close',anim,189,530,60,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_right_leaf_open.png',0,0,254,206,1,0)
	anim:SetHotSpot(127,103)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_right_leaf_open',anim,250,551,61,0,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_click_left_leaf',anim,165,563,100,0,1.35,1.5)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_click_right_leaf',anim,256,557,100,43,1.7,0.8)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_find_peg_1',anim,232,544,100,0,0.83,0.83)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_click_stone',anim,146,611,100,0,1.29,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_peg_on_leaf.png',0,0,158,150,1,0)
	anim:SetHotSpot(79,75)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_peg_on_leaf',anim,243,561,61,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_stone.png',0,0,166,120,1,0)
	anim:SetHotSpot(83,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_stone',anim,148,603,53,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_jug.png',0,0,66,98,1,0)
	anim:SetHotSpot(33,49)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_jug',anim,246,609,51,0,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_zoom_mill',anim,413,360,100,25,2.28,1.43)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_zoom_web',anim,399,210,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_drop_fly',anim,822,398,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_find_peg_2',anim,821,398,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/fly.png',0,0,59,59,1,0)
	anim:SetHotSpot(29,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('fly',anim,268,59,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/z_web/button/z_mill_reset.png',0,0,140,66,3,0)
	anim:SetHotSpot(70,33)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('z_mill_reset',anim,918,191,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_lily.png',0,0,104,50,1,0)
	anim:SetHotSpot(52,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_lily',anim,822,412,53,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_peg_2.png',0,0,80,80,1,0)
	anim:SetHotSpot(40,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_peg_2',anim,815,399,54,0,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(42,51)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_zoom_frog',anim,831,411,100,0,2,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/z_frog/z_frog_reset.png',0,0,142,50,3,0)
	anim:SetHotSpot(71,25)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('z_frog_reset',anim,902,249,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/deal2/jug.png',0,0,46,74,1,0)
	anim:SetHotSpot(23,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('jug',anim,244,60,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_click_stone2',anim,260,610,100,0,1.29,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_find_jug',anim,257,602,100,5,0.7,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_jug_dropped.png',0,0,62,86,1,0)
	anim:SetHotSpot(31,43)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_jug_dropped',anim,629,549,64,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/deal2/jug_with_water.png',0,0,38,71,1,0)
	anim:SetHotSpot(19,35)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('jug_with_water',anim,246,61,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/deal2/shovel_handle.png',0,0,72,134,1,0)
	anim:SetHotSpot(36,67)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('shovel_handle',anim,250,86,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_shovel_handle.png',0,0,72,134,1,0)
	anim:SetHotSpot(36,67)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_shovel_handle',anim,375,442,64,0,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_find_shovel_handle',anim,379,414,110,20,0.7,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,76)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_drop_shovel',anim,816,545.6,100,0,1.57,1.3)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/deal2/shovel.png',0,0,144,74,1,0)
	anim:SetHotSpot(72,37)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('shovel',anim,239,66,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_find_flower',anim,182,293,101,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_hole.png',0,0,124,44,1,0)
	anim:SetHotSpot(62,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_hole',anim,812,555,70,0,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_drop_jug_with_water',anim,804,528,100,0,1.42,1.27)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_drop_flower',anim,794,551,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/deal2/flower.png',0,0,101,80,1,0)
	anim:SetHotSpot(50,40)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('flower',anim,236,56,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/items/deal2/wave.png',0,0,82,78,1,0)
	anim:SetHotSpot(41,39)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('wave',anim,259,50,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_pipes.png',0,0,174,121,1,0)
	anim:SetHotSpot(87,60)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_pipes',anim,697,429,56,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_wheel_cover.png',0,0,424,149,1,0)
	anim:SetHotSpot(212,74)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_wheel_cover',anim,599,497,55,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_tower.png',0,0,244,506,1,0)
	anim:SetHotSpot(122,253)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_tower',anim,433,253,58,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_ivy.png',0,0,374,450,1,0)
	anim:SetHotSpot(187,225)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_ivy',anim,467,300,63,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/anim_flower.png',0,0,89,134,24,24)
	anim:SetHotSpot(44,67)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('anim_flower',anim,814,508,90,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/anim_web.jpg',0,0,96,126,24,24)
	anim:SetHotSpot(48,63)
	anim:SetBlendMode(0)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('anim_web',anim,391,213,60,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_sand_valve_3.png',0,0,236,134,1,0)
	anim:SetHotSpot(118,67)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_sand_valve_3',anim,645,554,61,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_sign.png',0,0,108,146,1,0)
	anim:SetHotSpot(54,73)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_sign',anim,761,484,90,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_gnome.png',0,0,208,348,1,0)
	anim:SetHotSpot(104,174)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_gnome',anim,153,286,55,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_flower1.png',0,0,144,112,1,0)
	anim:SetHotSpot(72,56)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_flower1',anim,195,286,61,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_gnome_face.png',0,0,110,94,1,0)
	anim:SetHotSpot(55,47)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_gnome_face',anim,151,292,70,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_gnome_cover.png',0,0,375,232,1,0)
	anim:SetHotSpot(187,116)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_gnome_cover',anim,187,451,56,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_shovel.png',0,0,74,46,1,0)
	anim:SetHotSpot(37,23)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_shovel',anim,322,311,55,0,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,96)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_zoom_rake',anim,155,612.68,100,0,1.86,1.49)
	
	anim = CreateAnimation('data/Texture/Common/area_round.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_zoom_valve',anim,604,483,100,0,1.63,1.47)
	
	anim = CreateAnimation('data/Texture/Scenes/06_garden/hp/layers/layer_mill_without_pegs.png',0,0,88,138,1,0)
	anim:SetHotSpot(44,69)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('layer_mill_without_pegs',anim,488,358,62,0,1,1)
	
end
-- CLEAR_ON_SAVE_END
