/**
 * This function calculates the total points a player earns in a game based on various factors.
 *
 * @param score The initial score achieved by the player.
 * @param multiplier The multiplier value to be applied to the score.
 * @param powerUp Indicates whether the player has activated a power-up.
 * @param isSpecialLevel Indicates whether the current level is a special level.
 * @return The final calculated total points earned by the player.
 */
fun calculatePoints(score: Int, multiplier: Int, powerUp: Boolean, isSpecialLevel: Boolean): Int {

    // Apply the multiplier
    var updatedScore = score * multiplier

    // Check if power-up is activated
    if (powerUp) {
        updatedScore += 100
    }

    // Check if the level is special
    if (isSpecialLevel) {
        updatedScore = updatedScore shl 1  // Left shift operator
    }

    // Check if the score is negative
    updatedScore = if (updatedScore >= 0) updatedScore else -updatedScore

    return updatedScore
}
/**
 * This function calculates the total points a player earns in a game based on various factors.
 *
 * @param score The initial score achieved by the player.
 * @param multiplier The multiplier value to be applied to the score.
 * @param powerUp Indicates whether the player has activated a power-up.
 * @param isSpecialLevel Indicates whether the current level is a special level.
 * @return The final calculated total points earned by the player.
 */
fun calculatePoints(score: Int, multiplier: Int, powerUp: Boolean, isSpecialLevel: Boolean): Int {
/**
 * This function calculates the total points a player earns in a game based on various factors.
 *
 * @param score The initial score achieved by the player.
 * @param multiplier The multiplier value to be applied to the score.
 * @param powerUp Indicates whether the player has activated a power-up.
 * @param isSpecialLevel Indicates whether the current level is a special level.
 * @return The final calculated total points earned by the player.
 */
fun calculatePoints(score: Int, multiplier: Int, powerUp: Boolean, isSpecialLevel: Boolean): Int {

    // Apply the multiplier
    var updatedScore = score * multiplier

    // Check if power-up is activated
    if (powerUp) {
        updatedScore += 100
    }

    // Check if the level is special
    if (isSpecialLevel) {
        updatedScore = updatedScore shl 1  // Left shift operator
    }

    // Check if the score is negative
    updatedScore = if (updatedScore >= 0) updatedScore else -updatedScore

    return updatedScore
}