-- Main game loop
function Main()

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

	SetGamePart(0); -- first load
	DoModal("scripts/loader.lua");

	-- Push the game selection screen
	while true do
		DoMainWindow("scripts/menu/mainmenu.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