diff --git a/docs/02-setup-main-game/05-main-scene/18-Gamble.md b/docs/02-setup-main-game/05-main-scene/18-Gamble.md index 0a50bad..5cdbe0e 100644 --- a/docs/02-setup-main-game/05-main-scene/18-Gamble.md +++ b/docs/02-setup-main-game/05-main-scene/18-Gamble.md @@ -6,18 +6,22 @@ description: Display Gamble # Gamble -### Overview +## Overview **Gamble** in slot games is a feature that lets players risk their winnings for a chance to double (or multiply) them, usually by guessing a card color. | Device Type | Preview | |---------------|-----------------------------------------------------------------------------| -| Desktop | ![Desktop](../img/05-main-scene/gamle/gamble-desktop.png) | -| Landscape | ![Landscape](../img/05-main-scene/gamle/gamble-landscape.png) | -| Portrait |
![Portrait](../img/05-main-scene/gamle/gamble-portrait.png)
| +| Desktop | ![Desktop](../img/05-main-scene/gamble/gamble-desktop.png) | +| Landscape | ![Landscape](../img/05-main-scene/gamble/gamble-landscape.png) | +| Portrait |
![Portrait](../img/05-main-scene/gamble/gamble-portrait.png)
| -### Scene Hierarchy +## Implementation + +### Prepare Assets + +#### Scene Hierarchy Place the node in the following scene structure: @@ -38,20 +42,21 @@ Place the node in the following scene structure: └── [gamble-loader] ``` -
![Scene Structure](../img/05-main-scene/gamle/gamble-structure.png)
+
![Scene Structure](../img/05-main-scene/gamble/gamble-structure.png)
--- -### Gamble Setup +### Setup - In node component include: - ![Scene Structure](../img/05-main-scene/gamle/gamble-component.png) +![Scene Structure](../img/05-main-scene/gamble/gamble-component.png) -#### `gamble-loader` +#### Components +**`gamble-loader`** - A component for managing the loading and unloading of gambling scenes in a game. | Property | Type | Description | @@ -59,4 +64,27 @@ Place the node in the following scene structure: | nodeBackground | cc.Node | Background node reference | | sceneGamble | String | Name of the gamble scene | | rootGambleName | String | Root node name for the gamble scene | -| rootGamble | Node | Runtime reference to the gamble root node (initialized in ctor) | + + +**`gamble-panel-mobile-scaler`** + +#### Backgrounds + +![Backgrounds](../img/05-main-scene/gamble/add-background-gamble.png) + +1. Use background scenes for the gamble feature: + - `gamble-background-landscape` : [Setup Background Landscape](/docs/setup-main-game/main-scene/background#2-setup-background-landscape) + + - `gamble-background-portrait` : [Setup Background Portrait](/docs/setup-main-game/main-scene/background#3-setup-background-portrait) + +2. Attach the `orientation-ui-controller` component to both `gamble-background-landscape` and `gamble-background-portrait` nodes. + 3. The `gamble-background-portrait` node has a dedicated component for portrait mode: + + ![gamble-background-portrait](../img/05-main-scene/gamble/gamble-portrait-component.png) + + This component handles properties and logic specific to the portrait layout. + +## Game Result Example + +Make sure the main scene includes the Win Limit Panel. +🔗 More Info [Game Result](/docs/setup-main-game/main-scene/win-limit#gamble-win-limit) \ No newline at end of file diff --git a/docs/02-setup-main-game/img/05-main-scene/gamble/add-background-gamble.png b/docs/02-setup-main-game/img/05-main-scene/gamble/add-background-gamble.png new file mode 100644 index 0000000..917362c Binary files /dev/null and b/docs/02-setup-main-game/img/05-main-scene/gamble/add-background-gamble.png differ diff --git a/docs/02-setup-main-game/img/05-main-scene/gamle/gamble-component.png b/docs/02-setup-main-game/img/05-main-scene/gamble/gamble-component.png similarity index 100% rename from docs/02-setup-main-game/img/05-main-scene/gamle/gamble-component.png rename to docs/02-setup-main-game/img/05-main-scene/gamble/gamble-component.png diff --git a/docs/02-setup-main-game/img/05-main-scene/gamle/gamble-desktop.png b/docs/02-setup-main-game/img/05-main-scene/gamble/gamble-desktop.png similarity index 100% rename from docs/02-setup-main-game/img/05-main-scene/gamle/gamble-desktop.png rename to docs/02-setup-main-game/img/05-main-scene/gamble/gamble-desktop.png diff --git a/docs/02-setup-main-game/img/05-main-scene/gamle/gamble-landscape.png b/docs/02-setup-main-game/img/05-main-scene/gamble/gamble-landscape.png similarity index 100% rename from docs/02-setup-main-game/img/05-main-scene/gamle/gamble-landscape.png rename to docs/02-setup-main-game/img/05-main-scene/gamble/gamble-landscape.png diff --git a/docs/02-setup-main-game/img/05-main-scene/gamble/gamble-portrait-component.png b/docs/02-setup-main-game/img/05-main-scene/gamble/gamble-portrait-component.png new file mode 100644 index 0000000..1eebc35 Binary files /dev/null and b/docs/02-setup-main-game/img/05-main-scene/gamble/gamble-portrait-component.png differ diff --git a/docs/02-setup-main-game/img/05-main-scene/gamle/gamble-portrait.png b/docs/02-setup-main-game/img/05-main-scene/gamble/gamble-portrait.png similarity index 100% rename from docs/02-setup-main-game/img/05-main-scene/gamle/gamble-portrait.png rename to docs/02-setup-main-game/img/05-main-scene/gamble/gamble-portrait.png diff --git a/docs/02-setup-main-game/img/05-main-scene/gamble/gamble-structure.png b/docs/02-setup-main-game/img/05-main-scene/gamble/gamble-structure.png new file mode 100644 index 0000000..f66d558 Binary files /dev/null and b/docs/02-setup-main-game/img/05-main-scene/gamble/gamble-structure.png differ diff --git a/docs/02-setup-main-game/img/05-main-scene/gamle/gamble-structure.png b/docs/02-setup-main-game/img/05-main-scene/gamle/gamble-structure.png deleted file mode 100644 index 761d86e..0000000 Binary files a/docs/02-setup-main-game/img/05-main-scene/gamle/gamble-structure.png and /dev/null differ