--/* Start File Header -------------------------------------------------------
--Copyright (C) 2010 DigiPen Institute of Technology.
--Reproduction or disclosure of this file or its contents without the prior written consent of DigiPen Institute of Technology is prohibited.
--File Name: init.lua
--Purpose: To provide functions, and call various code used in initializing the game.
--Authors: Robert Francis - 95%
--         Bryan Bishop   -  5%
--- End File Header --------------------------------------------------------*/

dofile "Resources\\lua\\defines.lua";

--AntTweak menus
--InitAntTweak();
--NewOptionalCoreModule("World_Editor");
--NewOptionalCoreModule("Model_Editor");
--NewOptionalCoreModule("ProtoEditor");
--NewOptionalCoreModule("Level_Editor");
--NewOptionalCoreModule("SpriteEditor");
--NewOptionalCoreModule("Debug_Menu");
--NewOptionalCoreModule("SysStats");
--NewOptionalCoreModule("LightEditor");
--NewOptionalCoreModule("ParticlesEditor");

--Collision bounding volumes
LoadModel("idle.xml");
LoadModel("jump_1.xml");
LoadModel("jump_2.xml");
LoadModel("jump_3.xml");
LoadModel("jump_4.xml");
LoadModel("jump_5.xml");
LoadModel("run.xml");
LoadModel("PHY_Floor_G.xml");
LoadModel("PHY_Floor_F.xml");
LoadModel("PHY_Floor_A.xml");
LoadModel("PHY_Floor_G.xml");
LoadModel("PHY_Floor_D.xml");
LoadModel("PHY_Door_Frame.xml");
LoadModel("PHY_Wall-B-Norm-Top.xml");
LoadModel("PHY_Wall-A-Outer-Top.xml");
LoadModel("PHY_Wall-A-Inner-Top.xml");
LoadModel("GAME_Endpoint.xml");
LoadModel("PHY_MovePlatform.xml");
LoadModel("GAME_Collect.xml");
LoadModel("GAME_Switch_On.xml");
LoadModel("Tile.xml");
LoadModel("GAME_Region.xml");
LoadModel("PHY_Floor_A_Destroyed.xml");
LoadModel("PHY_Floor_B.xml");
LoadModel("PHY_Floor_C.xml");
LoadModel("PHY_Rail_Outer_L_End.xml");
LoadModel("PHY_Rail_Outer_R_End.xml");
LoadModel("PHY_Rail_Norm.xml");
LoadModel("PHY_Prop_Crate.xml");
LoadModel("PHY_Roof_Norm.xml");
LoadModel("PHY_Wall-B-Norm.xml");
LoadModel("PHY_Prop_Pipe_2Bend.xml");
LoadModel("PHY_Prop_Pipe_2Join.xml");
LoadModel("PHY_Prop_Pipe_1Join.xml");
LoadModel("PHY_Door.xml");
LoadModel("PHY_Generator_Off.xml");
LoadModel("PHY_Generator_On.xml");
LoadModel("bubble.xml");
LoadModel("flow_Time.xml");
LoadModel("GAME_Bounce.xml");
LoadModel("GAME_Timestop.xml");
LoadModel("PHY_Cat_Fill.xml");
LoadModel("PHY_Cat_Half.xml");
LoadModel("PHY_Cat_Ledge_L_Join.xml");
LoadModel("PHY_Cat_Ledge_L_Turn.xml");
LoadModel("PHY_Cat_Ledge_R_Join.xml");
LoadModel("PHY_Cat_Ledge_R_Turn.xml");
LoadModel("PHY_Cat_Norm.xml");
LoadModel("PHY_Cat_Quarter.xml");
LoadModel("PHY_Cat_Side_Cap.xml");
LoadModel("PHY_Cat_Stairs.xml");
LoadModel("PHY_Cat_Turn.xml");
LoadModel("PHY_Prop_AudysseyLabs.xml");
LoadModel("PHY_Prop_BoxA.xml");
LoadModel("PHY_Prop_BoxB.xml");
LoadModel("PHY_Prop_Fan_A.xml");
LoadModel("PHY_Prop_HangLight.xml");
LoadModel("PHY_Prop_Pipe_1Bend.xml");
LoadModel("PHY_Prop_Pipe_1Reverse.xml");
LoadModel("PHY_Prop_Pipe_1Straight.xml");
LoadModel("PHY_Prop_Pipe_2Reverse.xml");
LoadModel("PHY_Prop_Pipe_2Straight.xml");
LoadModel("PHY_Prop_Shelf.xml");
LoadModel("PHY_Prop_SoundBoard.xml");
LoadModel("PHY_Prop_Vent.xml");
LoadModel("PHY_Prop_Vent_A.xml");
LoadModel("PHY_Prop_Vent_Corner.xml");
LoadModel("PHY_Rail_Norm_L_End.xml");
LoadModel("PHY_Rail_Norm_R_End.xml");
LoadModel("PHY_Rail_Outer_Norm.xml");
LoadModel("PHY_Table_Inner.xml");
LoadModel("PHY_Table_Norm.xml");
LoadModel("PHY_Table_Outer.xml");
LoadModel("PHY_Table_Top.xml");
LoadModel("PHY_Thorns.xml");
LoadModel("PHY_Wall-B-Inner.xml");
LoadModel("PHY_Wall-B-Inner-Top.xml");
LoadModel("PHY_Wall-B-Outer.xml");
LoadModel("PHY_Wall-B-Outer-Top.xml");
LoadModel("PHY_Wall_Window_A.xml");
LoadModel("Thorns.xml");
LoadModel("GAME_Platform.xml");
LoadModel("particle.xml");
LoadModel("Quad.xml");
LoadModel("grid.xml");
LoadModel("phyrotate.xml");
LoadModel("GAME_Active.xml");


--Fonts
LoadFont("umopmed");
LoadFont("ethnocentric");

CreateKeyboardAction(VK_A, "CamPosLeft");
CreateKeyboardAction(VK_D, "CamPosRight");
CreateKeyboardAction(VK_S, "CamPosBack");
CreateKeyboardAction(VK_W, "CamPosForward");
CreateKeyboardAction(VK_Q, "CamPosUp");
CreateKeyboardAction(VK_E, "CamPosDown");

CreateKeyboardAction(VK_J, "CamDirLeft");
CreateKeyboardAction(VK_L, "CamDirRight");
CreateKeyboardAction(VK_I, "CamDirForward");
CreateKeyboardAction(VK_K, "CamDirBack");

dofile "Resources\\lua\\levelLogic.lua";
dofile "Resources\\lua\\PauseFunctions.lua";
dofile "Resources\\lua\\TimeLogic.lua";

LoadTexture("story1.jpg");
LoadTexture("story2.jpg");
LoadTexture("story3.jpg");
LoadTexture("Digipen.dds");
LoadTexture("TeamLogo.png");

--Debug Keys
CreateKeyboardAction(VK_F2, "Debug");
CreateKeyboardAction(VK_F1, "console");
RegisterForInput("Debug", "ToggleDebug", ACTION_TRIGGER);
RegisterForInput("console", "ToggleConsole", ACTION_TRIGGER);
--ToggleDebug();

--Initialize Soundtrack
SetSoundLayer("Music_01", 0);
SetSoundLayer("Music_02", 1);
SetSoundLayer("Music_03", 2);
SetSoundLayer("Music_04", 3);
SetSoundLayer("Music_05", 4);
SetSoundLayer("Music_06", 5);
SetSoundLayer("Music_07", 6);
SetSoundLayer("Music_08", 7);
SetSoundLayer("Music_09", 8);
SetSoundLayer("Music_10", 9);
SetSoundLayer("Music_11", 10);
SetSoundLayer("Music_12", 11); -- Change after adding final layer

--Super Release Mode
Resize(0,0);
FullScreen(true);
HideWindowsCursor(true);
LoadLevel("Splash.xml");
CreateKeyboardAction(VK_X, "RestartToCheckPoint"); --X
CreateKeyboardAction(VK_M, "MapZoom");