local coroutineEntity = monocle.Entity()

local vector2 = require("#microsoft.xna.framework.vector2")

local vidPlayer = require("#Celeste.Mod.VidPlayer.VidPlayerEntityLua")
local v

function onBegin(room)
  disableMovement()
  player.ForceCameraUpdate = false
  playSound("event:/donk_Feather2026/sfx_DonkReels")
  wait(0.15)
  say("donkFeather2026_CrispyBowser")
  wait(0.5)
  walkTo(268, false, 1, false)
  wait(0.5)
  playSound("event:/donk_Feather2026/sfx_CrispyVoice")
  wait(3)
  say("donkFeather2026_CrispyBowserDies")
  playSound("event:/donk_Feather2026/sfx_CrispyDefeated")
  setFlag("donkFeather2026_Free", True)
  say("donkFeather2026_CrispyBowserDiesB")
  wait(1)
  engine.Scene:NextColorGrade("Feather2026/Donker19/blackFade")
  wait(1)
  v = vidPlayer.SpawnLoop("DonkFeather2026:/Graphics/Videos/Feather2026/Ending.ogv", 30, 0, 320, 180)
    wait(36.5)
    v:RemoveSelf()
  completeArea(True, False, True)
  enableMovement()
end

function onEnd(room, wasSkipped)
  completeArea(True, False, True)
  enableMovement()
  v:RemoveSelf()
  player.DummyAutoAnimate = true
  player.ForceCameraUpdate = true
  completeArea(True, False, True)
  getLevel():ResetZoom()
  enableMovement()
    if wasSkipped then
    v:RemoveSelf()
    player.DummyAutoAnimate = true
    player.ForceCameraUpdate = true
    completeArea(True, False, True)
    getLevel():ResetZoom()
    enableMovement()
    end
end