-- Main game loop
function Main()

	DisplaySplash("animations/flash/splash/kefsensei.swf", "animations/flash/splash/kefsensei",4000);
	-- This is technically not needed at the start of main, but it's included
	-- here to remind Playground users to call it before they call Load() again,
	-- so that their progress bar will work correctly.
	LoaderReset();

	-- Queue up some assets to load
	--	Load("scripts/preload.loader.lua","coreassets");
	-- Load("scripts/preload.loader.lua","mainmenu");

	-- Push the game selection screen
	while true 
	do
		DoMainWindow("scripts/dialogs/dialogmainmenu.lua");
		-- DoMainWindow will exit only if there are NO windows currently on the stack, so
		-- a PopModal()/PushModal() combination will not cause this to loop.
	end
end

-- Return a function to be executed in a thread
return Main