129 lines
4.0 KiB
Markdown
129 lines
4.0 KiB
Markdown
---
|
|
sidebar_position: 16
|
|
title: Free Round
|
|
description: Display and manage remaining free rounds in the game.
|
|
---
|
|
|
|
# Free Round
|
|
|
|
## Overview
|
|
|
|
- Handles the **display** and **logic** for tracking remaining free rounds in a slot game.
|
|
- Supports both **desktop** and **mobile**, including animation and event handling.
|
|
|
|
| Platform | Preview |
|
|
|----------|---------|
|
|
| Desktop |  |
|
|
| Mobile |  |
|
|
|
|
---
|
|
|
|
|
|
## Implementation
|
|
|
|
### Prepare Assets
|
|
|
|
- Copy or parse prefabs from core to game assets.
|
|
|
|
#### Core
|
|
|
|
| Path | Preview |
|
|
|------|---------|
|
|
| `assets/core-assets/hyper-core/packages/freeround-count-box/prefabs` |  |
|
|
|
|
#### Game
|
|
|
|
| Path | Preview |
|
|
|------|---------|
|
|
| `assets/game-assets/prefabs` | |
|
|
|
|
---
|
|
|
|
### Setup
|
|
|
|
- Ensure the script references the correct nodes.
|
|
|
|

|
|
|
|
- Manages and displays the remaining free round count in-game.
|
|
|
|
"
|
|
|
|
| Property | Description |
|
|
|---------------|--------------------------------------------|
|
|
| `duration` | Duration of fade in/out animation (seconds) |
|
|
| `content` | Container node for the counter |
|
|
| `labelLeft` | Label showing remaining free rounds |
|
|
|
|
---
|
|
|
|
#### Platform Setup
|
|
|
|
- Ensure that the desktop and mobile prefabs are positioned differently in the main game scene for proper layout on each platform.
|
|
|
|
##### Desktop
|
|
|
|

|
|
|
|
| Component | Description |
|
|
|-------------------------|-------------|
|
|
| `Platform-ui-controller` | [View Setup](/docs/faqs/setup-cocos-scene#platform-ui-controller) |
|
|
|
|
|
|
##### Mobile
|
|
|
|

|
|
|
|
| Component | Description |
|
|
|-------------------------|-------------|
|
|
| `Platform-ui-controller` | [View Setup](/docs/faqs/setup-cocos-scene#platform-ui-controller) |
|
|
| `UI Mobile Position` | [Mobile Position Setup](/docs/faqs/setup-cocos-scene#ui-mobile-landscape--portrait--position) |
|
|
|
|
---
|
|
|
|
#### Asset Setup
|
|
|
|
##### Desktop
|
|
|
|
| Path | Preview |
|
|
|------|---------|
|
|
| `assets/game-assets/textures/desktop/preloads/main-game/custom-scale` |  |
|
|
|
|
##### Mobile
|
|
|
|
| Path | Preview |
|
|
|------|---------|
|
|
| `assets/game-assets/textures/mobile/preloads/main-game/custom-scale` |  |
|
|
|
|
##### Common
|
|
|
|
- **Free Round Background**
|
|

|
|
|
|
🔗 More: [Game Asset Structure](/docs/category/game-asset-structure)
|
|
|
|
:::tip
|
|
- **Position & Size**: Follow the game design layout.
|
|
- **Asset Packing**: Use separate textures for Desktop and Mobile.
|
|
:::
|
|
|
|
---
|
|
|
|
#### Font Setup
|
|
|
|
| Preview |
|
|
|---------|
|
|
|  |
|
|
|
|
---
|
|
|
|
## Game Result Example
|
|
|
|
Make sure the main scene includes the popup panel.
|
|
🔗 [See Popup Panel Guide](/docs/setup-main-game/main-scene/popup-panel#multiple-popup-panel)
|
|
|
|
| Platform | Popup | Action | Result |
|
|
|----------|--------|---------------|--------|
|
|
| Desktop |  | Click → Start |  |
|
|
| Mobile |  | Click → Start |  |
|