public void ObstaclePassed() { SetScore(score++); levelCountdown--; if (obstacleManager.GetSpawnRate() > 500) { var rate = spawnRate - (score * 10); if (rate < 500) { rate = 500; } obstacleManager.SetSpawnRateInMilliseconds(rate); } }