dofile("scripts/entities/entityinclude.lua")

--function ASDFASFD end end end end

naija = 0
li = 0

function init()	
	n = getNaija()
	node = getNode("INSIDE")
	entity_setPosition(n, node_x(node), node_y(node))
	overrideZoom(0.9)
	
	fade(0, 0)
	
	start = getNode("SKY1")
	camDummy = createEntity("Empty")
	cam_toEntity(camDummy)
	entity_setPosition(camDummy, node_x(start), node_y(start)-400)
	entity_setPosition(camDummy, node_x(start), node_y(start), 7, 0, 0, 1)
	--cam_toNode()
	watch(1)
	fade2(0, 1, 1, 1, 1)
	watch(1)
	watch(4)
	fade2(1, 1, 1, 1, 1)
	watch(1)
	
	cam_toNode(getNode("NAIJALICAM"))
	watch(1)
	
	fade2(0, 1, 1, 1, 1)
	--watch(0.5)

	li = getEntity("YoungLi")
	naija = getEntity("NaijaChild")
	
	sx,sy = entity_getPosition(li)
	
	entity_setPosition(li, entity_x(li)-1024, entity_y(li), -100, 0, 0, 1)
	fadeIn(1)
	watch(1)
	
	watch(4)
	
	fade2(1, 1, 1, 1, 1)
	watch(1)

	entity_setPosition(li, sx, sy, 0.1)
	entity_setState(li, STATE_ON)
	
	cam_toEntity(naija)
	watch(1)
	
	--entity_swimToNode(naija, getNode("NAIJATO"))
	node = getNode("NAIJATO")
	
	entity_animate(naija, "swim", -1)
	entity_setPosition(naija, node_x(node), node_y(node), 6, 0, 0, 1)
	entity_rotate(naija, 45, 1, 0, 0, 1)
	
	fade2(0, 1, 1, 1, 1)
	watch(1)
	
	entity_rotate(naija, 0, 6, 0, 0, 1)
	
	--entity_watchForPath(naija)
	while entity_isInterpolating(naija) do
		watch(FRAME_TIME)
	end
	
	entity_flipToEntity(naija, li)
	entity_animate(naija, "idle", -1)
	
	
	
	cam_toNode(getNode("NAIJATO"))
	
	watch(1)
	
	-- li surprise
	entity_setState(li, STATE_OFF)
	
	-- look up
	entity_animate(naija, "wave", 0, 2)
	watch(4)
	
	entity_animate(naija, "inspect", 0, 2)
	watch(2)
	
	playSfx("NaijaChildGiggle")
	entity_animate(naija, "giggle", 6, 2)
	watch(2)
	
	-- naija leaves
	entity_swimToNode(naija, getNode("NAIJAOUT"))
	watch(2)
	
	-- li thoughtful
	entity_setState(li, STATE_ATTACK)
	
	watch(4)
	
	fade2(1, 2)
	watch(2)
	loadMap("Veil02", "SECRET03")
	
	
	
	--cam_toEntity(n)
end

