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

local oshiro
local oshiroB


function onBegin()
		local level = getLevel()
                level:add(coroutineEntity)
        oshiro = celeste.Mod.MaxHelpingHand.Entities.MoreCustomNPC.GetNPC("oshiro")
        oshiroB = celeste.Mod.MaxHelpingHand.Entities.MoreCustomNPC.GetNPC("oshiroB")


	disableMovement()
        getLevel():add(coroutineEntity)
		coroutine.yield(getLevel():ZoomTo(vector2(120, 100), 1.5, 0.75))
	helpers.say("DEBUT_INTRO")

	oshiroB.Position = vector2(oshiro.Position.X, oshiro.Position.Y)
	oshiro.Position = vector2(oshiro.X, oshiro.Y + 300)
        coroutineEntity:add(monocle.Coroutine(oshiroB:MoveTo(vector2(oshiroB.Position.X - 50, oshiroB.Y))))
	
	walk(-30)	
	jump(2)
	walk(-100)
        jump(0.4)
        wait(0.1)
        walk(-70)
	wait(0.1)


  teleportTo (0,0,"resort-chambre","WalkInLeft")
  enableMovement()
	
end

function onEnd(room, wasSkipped)
    if wasSkipped then
	teleportTo (0,0,"resort-chambre","WalkInLeft")
 	 enableMovement()
   end
end

