// Scaling factor for vertical offsets
const offsetScalingFactor = 0.4;

// Predefined vertical offsets represented as a 5x20 grid of zeros
export const verticalOffsets = [
    0,
    -35, -10, -5, 10, 15, 12, 5, -5, -12, -15, -12, -5, 5, 12, 15, 12, 5, -5, 10, 35,
    -35, -10, -5, 10, 15, 12, 5, -5, -12, -15, -12, -5, 5, 12, 15, 12, 5, -5, 10, 35,
    -35, -10, -5, 10, 15, 12, 5, -5, -12, -15, -12, -5, 5, 12, 15, 12, 5, -5, 10, 35,
    -35, -10, -5, 10, 15, 12, 5, -5, -12, -15, -12, -5, 5, 12, 15, 12, 5, -5, 10, 35,
    -35, -10, -5, 10, 15, 12, 5, -5, -12, -15, -12, -5, 5, 12, 15, 12, 5, -5, 10, 35,
];

/**
 * Gets a vertical offset value from the predefined array
 * @param {number} index - Index to retrieve from the offsets array
 * @returns {number} Offset value
 */

export const getVerticalOffset = (index) => {
    const normalizedIndex = index % verticalOffsets.length;
    const offset = verticalOffsets[normalizedIndex >= 0 ? normalizedIndex : 0];
    return offset * offsetScalingFactor; // Apply scaling factor
};