GameScreen.textures_path = "graphics/screens/18_teenager/location/"

function GameScreen:RestoreScene()
    if(GetState(CURRENT_SCREEN, "ho") == "") then
        SetState(CURRENT_SCREEN, "ho", "active")
        local tip_end = function()
            
        end
        self:StartHO();
        HUDScreen:ShowHintText({path = "graphics/screens/18_teenager/location/Hint_18", x = 522, y = 1128, end_fun = tip_end, loop = true})
    elseif(GetState(CURRENT_SCREEN, "ho") == "active") then
        self:StartHO();
    elseif(GetState(CURRENT_SCREEN, "ho") == "completed") then   
        clApplication:LoadLocation("Intro_04")
    end
    
    for found_item in string.gmatch(GetState(CURRENT_SCREEN, "found_obj"), "[_%a%d]+") do
		ItemRemove(self.name, found_item)
		ItemRemove(self.name, found_item.."_shadow")
		ItemRemove(self.name, found_item.."_text")
    end 
end


function GameScreen:InitScreen()
    self:LoadScreen()       
         
    self:RestoreScene();
    
    self:AddHiddenCrystal("crystal_18_part")
    
    self:SetItemSound("toy_plane", "sound/toy_plane.ogg");
    self:SetItemSound("sword", {"sound/sword_01.ogg", "sound/sword_02.ogg"});
    self:SetItemSound("balloon", {"sound/balloon_01.ogg", "sound/balloon_02.ogg"});
    self:SetItemSound("toy_car", "sound/toy_car.ogg");
    self:SetItemSound("phone", {"sound/phone_dial.ogg", "sound/phone_ring_long.ogg", "sound/phone_ring_short.ogg"});
    self:SetItemSound("aquarium", "sound/aquarium.ogg");
    self:SetItemSound("toy_clock", {"sound/toy_clock_windup.ogg", "sound/toy_clock_alarm.ogg"});
    self:SetItemSound("radio", {"sound/radio_tuning.ogg", "sound/radio_tuning_01.ogg"});
    self:SetItemSound("robot", "sound/robot.ogg");
    
    MusicPlay({"sound/ambient/18_ambient.ogg", "sound/music/surreal.ogg"} , 18) 
end

---------------------------------------------------------------------
function GameScreen:StartHO()
    local ho_end = function()  
        HintTest:RemoveLoop()
        Tip:RemoveLoop()
        self.mini_game = nil;
        SetState(CURRENT_SCREEN, "ho", "completed") 
        DelayedExec(2.0, function()
                  clApplication:LoadLocation("Intro_04")
        end)
    end

    self.item_list = {
        {obj = {"ufo", {x = 1118, y = 214}}, },
        {obj = {"shell", {x = 1221, y = 479}}, },
        {obj = {"truck", {x = 1014, y = 555}}, },
        {obj = {"ship", {x = 681, y = 500}}, },
        {obj = {"kite", {x = 745, y = 321}}, },
        {obj = {"heart", {x = 1018, y = 755}}, },
        {obj = {"ball", {x = 842, y = 779}},},
        {obj = {"feather", {x = 133, y = 101}}, },
        {obj = {"pawn", {x = 168, y = 950}}, },
        {obj = {"queen", {x = 1509, y = 916}}, },
        {obj = {"dino", {x = 200, y = 429}}, },
        {obj = {"rocket", {x = 1449, y = 256}}, },
        {obj = {"darts", {x = 0, y = 426}}, },
    }
    
    self:SetMiniGame(mgt_hidden_object)   
    self.mini_game:Init(self.item_list, ho_end, true);
end

function GameScreen:OnFinish()
end
------------------------------------------------------------------------------------------------------
-------------------------------------------Mouse functions--------------------------------------------
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
function GameScreen:LoadScreen()
	--[[---Background---]]--
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "18_teenager", "graphics/screens/18_teenager/location/18_teenager", 0, 0);
    
    self:CreateObj(OBJ_TYPE.TRIGGER, "toy_plane", "graphics/screens/18_teenager/location/toy_plane", 763, 232);
    self:CreateObj(OBJ_TYPE.TRIGGER, "sword", "graphics/screens/18_teenager/location/sword", 750, 711);
    self:CreateObj(OBJ_TYPE.TRIGGER, "balloon", "graphics/screens/18_teenager/location/balloon", 606, 395);
    self:CreateObj(OBJ_TYPE.TRIGGER, "toy_car", "graphics/screens/18_teenager/location/toy_car", 1293, 760);
    self:CreateObj(OBJ_TYPE.TRIGGER, "phone", "graphics/screens/18_teenager/location/phone", 1317, 881);
    self:CreateObj(OBJ_TYPE.TRIGGER, "aquarium", "graphics/screens/18_teenager/location/aquarium", 1236, 450);
    self:CreateObj(OBJ_TYPE.TRIGGER, "toy_clock", "graphics/screens/18_teenager/location/toy_clock", 1238, 592);
    self:CreateObj(OBJ_TYPE.TRIGGER, "radio", "graphics/screens/18_teenager/location/radio", 239, 664);
    self:CreateObj(OBJ_TYPE.TRIGGER, "robot", "graphics/screens/18_teenager/location/robot", 34, 50);
    
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "crystal_18_part", "graphics/screens/18_teenager/location/crystal_18_part", 257, 1030);
    
    
   self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "ufo_text", "graphics/screens/18_teenager/location/ufo_text", 256, 680);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "ufo", "graphics/screens/18_teenager/location/ufo_part", 1209, 259);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "shell", "graphics/screens/18_teenager/location/shell_part", 1263, 522);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "shell_text", "graphics/screens/18_teenager/location/shell_text", 698, 523);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "truck_text", "graphics/screens/18_teenager/location/truck_text", 337, 1003);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "truck", "graphics/screens/18_teenager/location/truck_part", 1064, 577);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "ship", "graphics/screens/18_teenager/location/ship_part", 735, 574);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "ship_text", "graphics/screens/18_teenager/location/ship_text", 1239, 1060);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "kite", "graphics/screens/18_teenager/location/kite_part", 801, 375);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "kite_text", "graphics/screens/18_teenager/location/kite_text", 1302, 797);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "heart", "graphics/screens/18_teenager/location/heart_part", 1059, 780);
self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "heart_shadow", "graphics/screens/18_teenager/location/heart_shadow", 1075, 791);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "heart_text", "graphics/screens/18_teenager/location/heart_text", 616, 419);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "ball", "graphics/screens/18_teenager/location/ball_part", 869, 807);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "ball_text", "graphics/screens/18_teenager/location/ball_text", 283, 29);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "feather_shadow", "graphics/screens/18_teenager/location/feather_shadow", 1257, 201);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "feather", "graphics/screens/18_teenager/location/feather_part", 200, 170);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "feather_text", "graphics/screens/18_teenager/location/feather_text", 882, 353);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "pawn_shadow", "graphics/screens/18_teenager/location/pawn_shadow", 140, 1042);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "pawn", "graphics/screens/18_teenager/location/pawn_part", 202, 1020);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "pawn_text", "graphics/screens/18_teenager/location/pawn_text", 1125, 0);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "queen", "graphics/screens/18_teenager/location/queen_part", 1526, 946);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "queen_text", "graphics/screens/18_teenager/location/queen_text", 1169, 18);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "dino", "graphics/screens/18_teenager/location/dino_part", 209, 440);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "dino_text", "graphics/screens/18_teenager/location/dino_text", 1485, 594);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "rocket", "graphics/screens/18_teenager/location/rocket_part", 1488, 350);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "rocket_text", "graphics/screens/18_teenager/location/rocket_text", 127, 753);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "darts", "graphics/screens/18_teenager/location/darts_part", 0, 450);
    self:CreateObj(OBJ_TYPE.ACTIVE_ALL, "darts_text", "graphics/screens/18_teenager/location/darts_text", 636, 1032);
 
    clScreenManager:add_screen("hud") 
end
