# Challenge Mode

Configure challenge-specific parameters for direct challenge launches.

| Parameter | Type | Description | Effect |
|-----------|------|-------------|--------|
| exercise | string | Challenge exercise identifier | Specifies which exercise to use for the challenge |
| countdown | number | Countdown duration in seconds | Sets the preparation countdown before challenge starts |
| reps | number | Target repetition count | Sets the goal number of reps for the challenge |
| gameTotalRounds | number | Total number of rounds (Color Chase only) | Controls how many rounds the Color Chase game lasts. Default is 10. Rounds beyond 10 are procedurally generated with increasing difficulty |

**Balloon Pop — rounds mode (special case):**

When you launch the **Balloon Pop** game and pass BOTH `reps` and `countdown`, the game switches from the default 30-second timer mode into a **rounds mode**:

- `reps` = number of rounds
- `countdown` = number of balloons spawned per round

The game ends after all rounds are completed. The HUD shows a round counter instead of a timer, and the difficulty stage indicator is hidden.

| Configuration | Behavior |
|---------------|----------|
| `reps: 4, countdown: 2` | 4 rounds × 2 balloons = 8 total pops |
| `reps: 3, countdown: 3` | 3 rounds × 3 balloons = 9 total pops |
| `reps: 6, countdown: 1` | 6 rounds × 1 balloon = 6 total pops (very easy) |
| `reps` not provided | Default timer mode (30s, escalating difficulty) |

**Challenge Mode Configuration**

_Swift (iOS)_
```swift
// Via customParams for challenge integration
kinestex.createChallengeView(
    exercise: exerciseId, // direct
    customParams: [
        "countdown": 5,
        "reps": 20,
        // Color Chase only:
        "gameTotalRounds": 15
        // Balloon Pop rounds-mode example:
        // "reps": 4, "countdown": 2  → 4 rounds × 2 balloons
    ]
)
```

_Kotlin (Android)_
```kotlin
// Via customParams for challenge integration
KinesteXSDK.createChallengeView(
    exercise = exerciseId, // direct
    customParams = mapOf(
        "countdown" to 5,
        "reps" to 20,
        // Color Chase only:
        "gameTotalRounds" to 15
        // Balloon Pop rounds-mode example:
        // "reps" to 4, "countdown" to 2  → 4 rounds × 2 balloons
    )
)
```

_React Native_
```jsx
// Via postData for challenge integration
const postData: IPostData = {
  key: 'YOUR_API_KEY',
  userId: 'user-123',
  company: 'YOUR_COMPANY',
  customParameters: {
    exercise: 'exerciseId',
    countdown: 5,
    reps: 20,
    // Color Chase only:
    gameTotalRounds: 15,
    // Balloon Pop rounds-mode example:
    // reps: 4, countdown: 2  → 4 rounds × 2 balloons
  },
};
```

_Flutter_
```dart
// Via customParams for challenge integration
KinesteXAIFramework.createChallengeView(
  exercise: exerciseId, // direct
  customParams: {
    "countdown": 5,
    "reps": 20,
    // Color Chase only:
    "gameTotalRounds": 15,
    // Balloon Pop rounds-mode example:
    // "reps": 4, "countdown": 2  → 4 rounds × 2 balloons
  },
);
```

_HTML / JavaScript_
```html
// Direct in postData object
const postData = {
  userId: "user-123",
  company: "YOUR_COMPANY",
  key: "YOUR_API_KEY",
  exercise: exerciseId,
  countdown: 5,
  reps: 20,
  // Color Chase only:
  gameTotalRounds: 15,
  // Balloon Pop rounds-mode example:
  // reps: 4, countdown: 2  → 4 rounds × 2 balloons
};
```

_React (TypeScript)_
```tsx
// Via postData for challenge integration
const postData: IPostData = {
  key: 'YOUR_API_KEY',
  userId: 'user-123',
  company: 'YOUR_COMPANY',
  customParameters: {
    exercise: 'exerciseId',
    countdown: 5,
    reps: 20,
    // Color Chase only:
    gameTotalRounds: 15,
    // Balloon Pop rounds-mode example:
    // reps: 4, countdown: 2  → 4 rounds × 2 balloons
  },
};
```

---
Source: https://kinestex.com/docs/customization-parameters/challenge-mode · Index: https://kinestex.com/llms.txt
