function onBegin() 
  local choice = seededRandom()
  local aimCenter = choice % 4 == 0

  local dist = player.Position.X - puppet.Position.X
  puppet.Facing = dist > 0 and 1 or dist < 0 and -1 or puppet.Facing

  playPuppetAnim("jumpstart")
  playSound("event:/CC/CC_HollowKnight/SFX/Boss SFX/NoskJump",puppet.Center)
  local direction = player.Position.X - puppet.Position.X
  if aimCenter then
    local center = getStoredObjectFromBoss("spawn_center")
    local distance = center - puppet.Position.X
    if math.abs(distance) > (20 * 8) then
      direction = distance
      if choice % 4 == 1 then
        forceNextAttackIndex(0)
      end
    end
  end

  local maxSpeed = 200

  if direction > maxSpeed then
    direction = maxSpeed
  elseif direction < -maxSpeed then
    direction = -maxSpeed
  end

  setSpeed(direction, -450)
  wait()

  while not puppet.Grounded do
    wait()
  end
  playPuppetAnim("jumpend")
  playSound("event:/CC/CC_HollowKnight/SFX/Boss SFX/NoskLand",puppet.Center)
  setSpeed(0,0)
  wait(0.3)
end