local monocle = require("#monocle")
local coroutineEntity = monocle.Entity()
local celeste = require("#celeste")

local cresseliadroite
local cresseliagauche

function onBegin()
		local level = getLevel()
		local luanet = _G.luanet
	cresseliadroite = celeste.Mod.MaxHelpingHand.Entities.MoreCustomNPC.GetNPC("cresseliadroite")
	cresseliagauche = celeste.Mod.MaxHelpingHand.Entities.MoreCustomNPC.GetNPC("cresseliagauche")


		disableMovement()
		getLevel():add(coroutineEntity)
		helpers.setPlayerState(18)
 		player.Speed = vector2(0, 500)
		wait(2)
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))

		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))
		wait(0.5)
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X - 2000, cresseliagauche.Y))))
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X - 2000, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X - 2000, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X - 300, cresseliagauche.Y + 1000))))

		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 2000, cresseliagauche.Y))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 2000, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 2000, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 300, cresseliagauche.Y + 1000))))
		wait(1.3)
		cresseliadroite.Position = vector2(cresseliagauche.Position.X, cresseliagauche.Position.Y)
		cresseliagauche.Position = vector2(cresseliagauche.X, cresseliagauche.Y + 1000)
		wait(0.7)
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))

		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))
		wait(0.2)
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))

		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))
		wait(0.2)
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X + 2000, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X + 1000, cresseliagauche.Y + 1000))))

		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X + 2000, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X + 1000, cresseliagauche.Y + 1000))))
		wait(0.2)
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X + 2000, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X + 1000, cresseliagauche.Y + 1000))))

		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X + 2000, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))
		wait(0.2)
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X + 1500, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X + 500, cresseliagauche.Y + 500))))
		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X + 500, cresseliagauche.Y + 200))))

		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X + 1500, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X + 500, cresseliagauche.Y + 500))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X + 500, cresseliagauche.Y + 200))))
		wait(0.3)
		cresseliagauche.Position = vector2(cresseliadroite.Position.X, cresseliadroite.Position.Y)
		cresseliadroite.Position = vector2(cresseliadroite.X, cresseliadroite.Y - 1000)
		wait(0.2)
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 4000, cresseliagauche.Y + 1000))))

		coroutineEntity:add(monocle.Coroutine(cresseliadroite:MoveTo(vector2(cresseliagauche.Position.X - 4000, cresseliagauche.Y + 1000))))
		wait(0.5)
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 4000, cresseliagauche.Y + 2000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 500))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 500))))
		wait(0.7)
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 2000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 2000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X, cresseliagauche.Y + 500))))
		wait(0.2)
	setFlag("fade", true)

		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 30000, cresseliagauche.Y))))
		wait(0.2)
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 30000, cresseliagauche.Y))))
		wait(0.2)
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y - 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y - 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y - 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 30000, cresseliagauche.Y - 1000))))
		wait(0.2)
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y - 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y - 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 50000, cresseliagauche.Y - 1000))))
		coroutineEntity:add(monocle.Coroutine(cresseliagauche:MoveTo(vector2(cresseliagauche.Position.X - 30000, cresseliagauche.Y - 1000))))


		wait(2)
		helpers.completeArea (false ,true, true)

end
