-- Main game loop
-- assets/Game/UI/PiEyeSplash/PiEyeAnim.swf

function Main()

	DisplaySplash("assets/splash/playfirst_animated_logo.swf", "splash/playfirst_logo",4000);
	--DisplaySplash("Game/UI/PiEyeSplash/PiEyeAnim.swf", "Game/UI/PiEyeSplash/PiEyeStatic.jpg",4000);
	DoModal("scripts/pieye.lua");
	DisplaySplash("", "assets/Splash/distributor_logo",4000);
	
	DoModal("scripts/loading.lua");
	DoModal("scripts/mainmenu.lua");

	while (true) do
		-- Push the game selection screen
		--DoModal("scripts/mainmenu.lua");
		-- The game select screen will spawn its own replacement modal window. When that modal window
		-- returns, it will be time to execute this one again--hence the while/do loop.
	end

end

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