-- Main game loop
require( "scripts/effects.lua" );

function Main()

DisplaySplash(
		"",
		"splash/portal",4000
		);

	DisplaySplash(
		"",
		"splash/splash",4000
		);

	DisplaySplash(
		"",
		"splash/xitex_logo",4000
		);

	DoMainWindow("scripts/checkprofile.lua");
	-- Push the game selection screen
	while true do
		DoMainWindow("scripts/mainmenu.lua");
		-- DoMainWindow will exit only if there are NO windows pushed 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