/**
 * This function checks if the player's position intersects with any obstacles on the map.
 *
 * @param playerPosition The x and y coordinates of the player.
 * @param obstaclePositions The x and y coordinates of the obstacles.
 * @return True if the player collides with any obstacle, False otherwise.
 */
fun checkCollision(playerPosition: Pair<Int, Int>, obstaclePositions: List<Pair<Int, Int>>): Boolean {

    for (obstacle in obstaclePositions) {
        if (playerPosition.first == obstacle.first && playerPosition.second == obstacle.second) {
            return true
        }
    }
    return false
}
/**
 * This function checks if the player's position intersects with any obstacles on the map.
 *
 * @param playerPosition The x and y coordinates of the player.
 * @param obstaclePositions The x and y coordinates of the obstacles.
 * @return True if the player collides with any obstacle, False otherwise.
 */
fun checkCollision(playerPosition: Pair<Int, Int>, obstaclePositions: List<Pair<Int, Int>>): Boolean {
/**
 * This function checks if the player's position intersects with any obstacles on the map.
 *
 * @param playerPosition The x and y coordinates of the player.
 * @param obstaclePositions The x and y coordinates of the obstacles.
 * @return True if the player collides with any obstacle, False otherwise.
 */
fun checkCollision(playerPosition: Pair<Int, Int>, obstaclePositions: List<Pair<Int, Int>>): Boolean {

    for (obstacle in obstaclePositions) {
        if (playerPosition.first == obstacle.first && playerPosition.second == obstacle.second) {
            return true
        }
    }
    return false
}