---
sidebar_position: 3
---
# Respin Feature

### Overview
**Respin** is a bonus mechanic in slot games that allows players to re-spin selected reels without restarting the full spin.  
It typically triggers after a specific in-game condition (e.g. near-win or bonus hit) and enhances player engagement.

> Respin ends when the respin counter reaches **zero**.

```mermaid
stateDiagram-v2
    Spin --> SpinEnd 
    Spin --> Condition_Trigger : case Special

    SpinEnd --> Condition_Trigger : No Win
    SpinEnd --> Win
    Win --> Win_Complete : case normal
    Win_Complete --> Condition_Trigger
    Condition_Trigger --> Trigger_Respin
    ```
---

### Main Scene

#### Triggering Respin
- Triggered by game logic after a win or specific pattern.
- Node setup required in Scene graph.

| Action | Image |
|--------|-------|
| Create Respin Trigger Node | ![Trigger](./img/respin/node-trigger-in-scenes.png) |

#### Respin Feature
1. **Trigger Respin**  
   ![Trigger](./img/respin/trigger.png)

2. **Re-trigger Respin**  
   ![Retrigger](./img/respin/retrigger.png)

3. **Respin Win**  
   This step handles the outcome evaluation after a respin.  
   Its implementation depends on the specific game design and may be optional in some games.

---

### Handle Event

#### Respin Event Handling
- Override class: `hyper-gaming-server-handler`

| Process | Image |
|---------|-------|
| Listen for event: `"respins" | ![Script](./img/respin/handle-event.png) |
| Trigger Data from Server | ![Trigger](./img/respin/handle-trigger.png) |
| Re-trigger Data | ![Retrigger](./img/respin/handle-retrigger.png) |

---

### Feature Management

#### Feature Class Setup
- Create `feature-respin` class extending `feature-game`
- Responsibilities:
  - Manage respin panel UI
  - Handle trigger & retrigger logic

| Action | Image |
|--------|-------|
| Script: Feature Panel | ![Script](./img/respin/script-feature-respin.png) |
| Script: Trigger/Retrigger | ![Trigger](./img/respin/script-trigger-retrigger.png) |
