2025-05-19 12:03:32 +07:00

128 lines
5.7 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.
| Orientation | Preview |
|-------------|---------|
| Desktop | ![Desktop](../img/05-main-scene/freeround-counter/overview-freeround-desktop.png) |
| Mobile | ![Mobile](../img/05-main-scene/freeround-counter/overview-freeround.png) |
---
## Implementation
### Prefab Location
#### In Core
| Path | Example |
|---------------------------------------------------------------------|------------------------------------------------------------------------------------------|
| `assets\core-assets\hyper-core\packages\freeround-count-box\prefabs` | <center>![Core Prefab](../img/05-main-scene/freeround-counter/freeround-path-prefabs.png)</center> |
#### In Game
| Path | Example |
|-----------------------------------|---------------------------------------------------------------------------------------------------|
| `assets\game-assets\prefabs` | <center>![Copied Prefab](../img/05-main-scene/freeround-counter/freeround-path-prefabs-in-game.png)</center> |
### General Setup
![Copied Prefab](../img/05-main-scene/freeround-counter/freeround-counter-general.png)
- Component that manages and displays the free rounds counter.
![Copied Prefab](../img/05-main-scene/freeround-counter/freeround-counter-setting-general.png)
**platform** **(<span class="red-star">*</span>)**: Desktop / Mobile
| Property | Description |
|---------------|------------------------------------------|
| `duration` | Animation duration in seconds (fade In/Out) |
| `content` | Container node for the counter |
| `labelLeft` | Label displaying remaining free rounds |
---
### Platform Setup
#### Desktop
![Overview](../img/05-main-scene/freeround-counter/freeround-counter-setup-desktop.png)
| Component | Description |
|--------------------------|---------------------------------------------------------------------------------------------------------------|
| `Platform-ui-controller` | [Platform UI Controller](http://localhost:3000/docs/faqs/setup-cocos-scene#Platform-ui-controller) |
#### Prepare Assets
| Path in Game | Example |
|--------------------------|---------------------------------------------------------------------------------------------------------------|
| `assets\game-assets\textures\desktop\preloads\main-game\custom-scale` | ![Assets Desktop](../img/05-main-scene/freeround-counter/assets-freeround-desktop.png) |
---
#### Mobile
![Overview](../img/05-main-scene/freeround-counter/freeround-counter-setup-mobile.png)
| Component | Description |
|-----------------------|--------------------------------------------------------------------------------------------------------------------------|
| `Platform-ui-controller` | [Platform UI Controller](http://localhost:3000/docs/faqs/setup-cocos-scene#Platform-ui-controller) |
| `UI Mobile Position` | [UI Mobile Position](http://localhost:3000/docs/faqs/setup-cocos-scene#ui-mobile-landscape--portrait--position) |
#### Prepare Assets
| Path in Game | Example |
|--------------------------|---------------------------------------------------------------------------------------------------------------|
| `assets\game-assets\textures\mobile\preloads\main-game\custom-scale` | ![Assets Mobile](../img/05-main-scene/freeround-counter/assets-freeround-mobile.png) |
#### Common Assets
- Free Round Background:
![Assets Mobile](../img/05-main-scene/freeround-counter/assets-freeround-background.png)
🔗 More Info To Pack Assets: [Game Asset Structure](http://localhost:3000/docs/category/game-asset-structure)
:::tip
- **Position and Size**: Follow the game design specifications.
- **Asset Packing**: Use separate texture packs for Desktop and Mobile platforms.
:::
### Font Setup
<table>
<thead>
<tr>
<th style={{ width: "700px" }}>Preview</th>
</tr>
</thead>
<tbody>
<tr>
<td><center>![Add Font](../img/05-main-scene/freeround-counter/add-font.png)</center></td>
</tr>
</tbody>
</table>
## Game Result Examples
*To show the free round popup, make sure the main scene includes the popup panel.*
<span class="red-star">*</span> More Info: [Popup Panel](http://localhost:3000/docs/setup-main-game/main-scene/popup-panel#multiple-popup-panel)
|Platform|Popup|Action|Result|
|--------|-----|------|------|
|Desktop|![Desktop](../img/05-main-scene/freeround-counter/popup-freeround-counter-desktop.png)|click → Start|![Add Font](../img/05-main-scene/freeround-counter/overview-freeround-desktop.png)|
|Mobile|![Mobile](../img/05-main-scene/freeround-counter/popup-freeround-counter-mobile.png)|click → Start|![Add Font](../img/05-main-scene/freeround-counter/overview-freeround.png)|