dofile("scripts/maps/finalcommon.lua")

function hasQuit()
	if not (getEnqueuedState() == "") then
		fade2(1, 0, 1, 1, 1)
		return true
	end
	return false
end

function init()
	--return
	fade2(0, 0, 1, 1, 1)
	overrideZoom(0.8)
	n = getNaija()
	entity_setPosition(n, 0, 0)
	playMusicOnce("Intro")
	
	user_set_demo_intro(0)
	user_save()
	
	camDummy = createEntity("Empty")
	start1 = getNode("START1")
	start2 = getNode("START2")
	start3 = getNode("START3")
	
	end1 = getNode("END1")
	end2 = getNode("END2")
	end3 = getNode("END3")
	
	-- 1
	entity_warpToNode(camDummy, start1)
	cam_toEntity(camDummy)
	entity_swimToNode(camDummy, end1, SPEED_SLOW)
	
	fade(0, 4)
	watch(4)
	if hasQuit() then return end
	watch(3)
	if hasQuit() then return end
	fade(1, 4)
	watch(4)
	if hasQuit() then return end
	
	-- 2
	entity_warpToNode(camDummy, start2)
	cam_toEntity(camDummy)
	entity_swimToNode(camDummy, end2, SPEED_SLOW)
	
	fade(0, 6)
	watch(6)
	if hasQuit() then return end
	fade(1, 6)
	watch(6)
	if hasQuit() then return end
	
	-- 3
	entity_warpToNode(camDummy, start3)
	cam_toEntity(camDummy)
	entity_swimToNode(camDummy, end3, SPEED_SLOW)
	
	fade(0, 4)
	watch(4)
	if hasQuit() then return end
	watch(4)
	if hasQuit() then return end
	
	
	overrideZoom(1, 6)
	watch(2)
	watch(2.5)
	
	
	--watch(5)
	
	
	fade2(1, 2, 1, 1, 1)
	watch(2)
	if hasQuit() then return end
	--jumpState("Title")
	loadMap("Title")
end


