-- Main game loop
function Main()


	DisplaySplash("splash/publisher.swf", "",4000);
	DisplaySplash("splash/kefsensei.swf", "",4000);
	DisplaySplash("splash/distributor_logo.swf", "splash/distributor_logo", 4000);

	-- Push the game selection screen
	
	gLevel = 1;
	gScore = 0;
	gMetamapFlag = 1;
	gInGame = 0;
	
	gTrackingLevel = 0;
	
	level_status = {}    -- new array
    for i=1, 50 do
      level_status[i] = 'no yet won'
    end
	
	while true do
		DoMainWindow("scripts/welcome.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