candidate: If an offensive player is fouled while not in the act of shooting , or if a player is fouled in a loose - ball situation , the penalty varies by level of play and the number of fouls accumulated by the opposing team in a given period .