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

local badeline


function onBegin()
		local level = getLevel()
		local luanet = _G.luanet
		wait(0.2)
		disableMovement()
		getLevel():add(coroutineEntity)
		level.Displacement:AddBurst(player.Position, 0.5, 8, 32, 0.5)
		coroutine.yield(player:CreateSplitParticles())
		badeline = celeste.BadelineDummy(player.Position + vector2(-2, -8))
		badeline.Sprite.Scale = vector2(1, 1)
		level:Add(badeline)
		playSound("event:/char/badeline/maddy_split", player.Position)
		coroutine.yield(badeline:FloatTo(player.Position + vector2(20, -16), -1, true, false, true))
		wait(0.5)
		helpers.say("ROOM8_SHAKE")
		coroutine.yield(badeline:Vanish())
		enableMovement()
end