Add setup project and main game
41
README.md
Normal file
@ -0,0 +1,41 @@
|
||||
# Website
|
||||
|
||||
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
|
||||
|
||||
### Installation
|
||||
|
||||
```
|
||||
$ yarn
|
||||
```
|
||||
|
||||
### Local Development
|
||||
|
||||
```
|
||||
$ yarn start
|
||||
```
|
||||
|
||||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
||||
|
||||
### Build
|
||||
|
||||
```
|
||||
$ yarn build
|
||||
```
|
||||
|
||||
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
||||
|
||||
### Deployment
|
||||
|
||||
Using SSH:
|
||||
|
||||
```
|
||||
$ USE_SSH=true yarn deploy
|
||||
```
|
||||
|
||||
Not using SSH:
|
||||
|
||||
```
|
||||
$ GIT_USER=<Your GitHub username> yarn deploy
|
||||
```
|
||||
|
||||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
69
docs/01-setup-the-project/01-create-the-project.md
Normal file
@ -0,0 +1,69 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Create The Project
|
||||
|
||||
The first step to start a new project.
|
||||
|
||||
When starting a new project, you'll be giving an empty repository.
|
||||
|
||||
Take the `Roma Legacy` game as an example.
|
||||
|
||||
## Clone Git repository
|
||||
|
||||
To clone this repository, run the following command:
|
||||
|
||||
```bash
|
||||
git clone https://gitea.plp19.com/cocos-eanew/coc-roma-legacy.git
|
||||
```
|
||||
|
||||
Once cloned, configure your Git user information (only needed the first time):
|
||||
|
||||
```bash
|
||||
cd coc-roma-legacy
|
||||
git config user.name "Your Git Username"
|
||||
git config user.email "Your Email"
|
||||
```
|
||||
|
||||
## Create Cocos Creator project
|
||||
|
||||
Inside `coc-roma-legacy` folder, create a `project.json` file:
|
||||
|
||||
```json title="project.json"
|
||||
{
|
||||
"engine": "cocos-creator-js",
|
||||
"packages": "packages",
|
||||
"name": "coc-roma-legacy",
|
||||
"version": "2.4.4",
|
||||
"isNew": false
|
||||
}
|
||||
```
|
||||
|
||||
Now you can open the project in `Cocos Creator`.
|
||||
|
||||
1. Launch **Cocos Dashboard**
|
||||
2. Click **Add Project**
|
||||
3. Navigate to **coc-roma-legacy** folder
|
||||
4. Click **Select Project**.
|
||||
|
||||

|
||||
|
||||
Now that the project is available in `Cocos Dashboard`, double-click on it to open.
|
||||
|
||||
`Cocos Creator` will generate the entire game structure including `.gitignore` file.
|
||||
|
||||

|
||||
|
||||
## Commit to Git
|
||||
|
||||
At this point, you should create an initial commit and open your first `Pull Request`.
|
||||
|
||||
Run these following command:
|
||||
|
||||
```bash
|
||||
git checkout -b feature/init-project
|
||||
git add --a
|
||||
git commit -m "Init cocos project"
|
||||
git push --set-upstream origin feature/init-project
|
||||
```
|
92
docs/01-setup-the-project/02-add-submodules.md
Normal file
@ -0,0 +1,92 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Add Submodules
|
||||
|
||||
Let's add more packages and templates to the project.
|
||||
|
||||
A slot game project is composed of multiple Git repositories used as [submodules](https://www.atlassian.com/git/tutorials/git-submodule).
|
||||
|
||||
It is important to understand the responsibilities of each submodule.
|
||||
|
||||
We recommend reviewing the [Slot Core Submodule documentation](../category/submodules/) before proceeding.
|
||||
|
||||
## Main submodules
|
||||
|
||||
These are submodules presented in every Slot Game project.
|
||||
|
||||
To add main submodules, run the following commands:
|
||||
|
||||
```bash
|
||||
git submodule add -f ../base-slot-template.git assets/core-assets/slotty-core
|
||||
git submodule add -f ../game-core-template.git assets/core-assets/game-core
|
||||
git submodule add -f ../hyper-slot-template.git assets/core-assets/hyper-core
|
||||
```
|
||||
|
||||
To add packages submodule, first **delete packages folder**.
|
||||
|
||||
Then run the follwing command:
|
||||
|
||||
```bash
|
||||
git submodule add -f ../hyper-editor-package.git packages
|
||||
```
|
||||
|
||||
## Internation Theme vs Chinese Theme
|
||||
|
||||
Depend on the theme of your game, add these commands:
|
||||
|
||||
For `International Theme`:
|
||||
|
||||
```bash
|
||||
git submodule add -f ../hyper-wintune-international.git assets/core-assets/hyper-wintune-international
|
||||
git submodule add -f ../hyper-coin-shower-international.git assets/core-assets/hyper-coin-shower-international
|
||||
git submodule add -f ../hyper-dialog-international.git assets/core-assets/hyper-dialog-international
|
||||
```
|
||||
|
||||
For `Chinese Theme`:
|
||||
|
||||
```bash
|
||||
git submodule add -f ../hyper-wintune-chinese.git assets/core-assets/hyper-wintune-chinese
|
||||
git submodule add -f ../hyper-coin-shower-chinese.git assets/core-assets/hyper-coin-shower-chinese
|
||||
git submodule add -f ../hyper-dialog-chinese.git assets/core-assets/hyper-dialog-chinese
|
||||
```
|
||||
|
||||
## Optional Submodule
|
||||
|
||||
These are submodules for specific feature including: `landing sound`, effect `win border/tension` and `hyper jackpot`.
|
||||
|
||||
Add one or more of those submodules depends on the game design.
|
||||
|
||||
```bash
|
||||
git submodule add -f ../hyper-jackpot-package.git assets/core-assets/hyper-jackpot
|
||||
git submodule add -f ../hyper-win-border-and-tension.git assets/core-assets/hyper-win-border-and-tension
|
||||
git submodule add -f ../hyper-scatter-landing-sound.git assets/core-assets/hyper-scatter-landing-sound
|
||||
```
|
||||
|
||||
## Update submodules to latest commit
|
||||
|
||||
All submodules should be on master branch and update to the latest commit.
|
||||
|
||||
To fetch the latest update, run the following command:
|
||||
|
||||
```bash
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
:::tip
|
||||
You can drop the `--init` after the first time.
|
||||
:::
|
||||
|
||||
## Commit to git
|
||||
|
||||
Now that we add all nesscessary submodule to the project, let's commit all of these change to open a Pull Request:
|
||||
|
||||
Run these following command:
|
||||
|
||||
```bash
|
||||
git checkout -b feature/add-submodules
|
||||
git add --a
|
||||
git commit -m "Add submodules"
|
||||
git push --set-upstream origin feature/add-submodules
|
||||
```
|
35
docs/01-setup-the-project/03-set-custom-engine.md
Normal file
@ -0,0 +1,35 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
# Set Custom Cocos Engine
|
||||
|
||||
Link project to a custom Cocos Engine.
|
||||
|
||||
Thank to the open source nature of Cocos Creator, we are able to customize some of the function in the source code to meet the requirement for Hyper Slot Game.
|
||||
|
||||
For the detail of the Custom Engine, take a look at this [**Custom Cocos Engine documentation**](../custom-cocos-engine/custom-cocos-engine.md)
|
||||
|
||||
**Clone the repository**
|
||||
|
||||
This custom engine can be universally used for all Hyper Slot Game project. So you only have to do this step once.
|
||||
|
||||
Choose your working directory and clone this repo using the following command:
|
||||
|
||||
```bash
|
||||
git clone https://gitea.plp19.com/cocos-core/cocos-creator-engine.git
|
||||
```
|
||||
|
||||
**Set custom engine in Cocos Creator**
|
||||
|
||||
Open the project in Cocos Creator.
|
||||
|
||||
From the main menu, choose `Projects` -> `Project Settings`
|
||||
|
||||

|
||||
|
||||
Click on the `Custom Engine` tab, set `Javascript Engine Path` to the `cocos-creator-engine` folder.
|
||||
|
||||
Click `Save` and restart Cocos Creator.
|
||||
|
||||

|
52
docs/01-setup-the-project/04-create-game-folder-structure.md
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# Create Game Folder Structure
|
||||
|
||||
Make a folder structure for all the game assets.
|
||||
|
||||
Inside the `assets` folder, we already have a `core-assets` folder which contains all assets of the template submodule.
|
||||
|
||||
We need to have a `game-assets` folder to contain the assets for our game.
|
||||
|
||||
Create the following folder structure:
|
||||
|
||||

|
||||
|
||||
Next we're gonna use our first template assets - the template cocos scenes.
|
||||
|
||||
These scenes are already setup and ready to use.
|
||||
|
||||
Copy all Cocos scene assets from `assets/core-assets/hyper-core/scenes` to ` assets/game-assets/scenes`.
|
||||
|
||||
Rename those scenes:
|
||||
- `template-loading` -> `loading`
|
||||
- `template-main-game` -> `main-game`
|
||||
- `template-preload` -> `preload`
|
||||
- `template-preview` -> `preview`
|
||||
|
||||

|
||||
|
||||
Inside `assets/game-assets/scripts/`, create a folder called `custome-scaler` then add a script `custom-scale-data.js`.
|
||||
|
||||

|
||||
|
||||
The setup is complete. You should create a commit and open Pull Request.
|
||||
|
||||
Run these following command:
|
||||
|
||||
```bash
|
||||
git checkout -b feature/setup-folder-structure
|
||||
git add --a
|
||||
git commit -m "Setup Folder Structure"
|
||||
git push --set-upstream origin feature/setup-folder-structure
|
||||
```
|
||||
|
||||
:::warning
|
||||
Notice that you can only commit `game-asset`, `scripts` and `scenes`.
|
||||
|
||||
Git automatically ignores empty folders, so don't be alarmed if they don't appear in your commits.
|
||||
|
||||
No worries—these folders will soon be filled with plenty of assets!
|
||||
:::
|
17
docs/01-setup-the-project/_category_.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"position": 1,
|
||||
"label": "Setup The Project",
|
||||
"collapsible": true,
|
||||
"collapsed": false,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"title": "Start a new project",
|
||||
"description": "This section will guide you through the process of setting up a new project, including creating a new repository and configuring your development environment.",
|
||||
"keywords": [
|
||||
"setup",
|
||||
"project",
|
||||
"repository",
|
||||
"development environment"
|
||||
]
|
||||
}
|
||||
}
|
BIN
docs/01-setup-the-project/img/cocos-dashboard.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
docs/01-setup-the-project/img/cocos-folder-structure.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
docs/01-setup-the-project/img/custom-scale.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
docs/01-setup-the-project/img/game-assets.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/01-setup-the-project/img/project-setting.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
docs/01-setup-the-project/img/set-custom-engine.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
docs/01-setup-the-project/img/template-scenes.png
Normal file
After Width: | Height: | Size: 85 KiB |
172
docs/02-setup-main-game/01-add-game-config.md
Normal file
@ -0,0 +1,172 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Adding Game Configuration
|
||||
|
||||
While the core logic is responsible for calculations and maintaining the game state, it's the client's responsibility to define all game-specific information.
|
||||
|
||||
Let’s go step-by-step to define these elements.
|
||||
|
||||
## Slot Items
|
||||
|
||||
Each game features specific slot items displayed on the reel panel. By default, the Slot Core includes only two items: **Wild** and **Scatter**.
|
||||
|
||||
For `Roma Legacy`, there are 8 slot items total, including **Wild**.
|
||||
|
||||

|
||||
|
||||
To define the 7 additional items for this game, create the following script:
|
||||
|
||||
```jsx title="assets/game-assets/scripts/slotty-settings/slotty-item.js"
|
||||
var SlottyItem = p4fslot.require('slotty-item');
|
||||
var Enum = p4fslot.require('extendable-enum');
|
||||
|
||||
Enum.InitEnum(SlottyItem, [
|
||||
'Pic1',
|
||||
'Pic2',
|
||||
'Pic3',
|
||||
'Pic4',
|
||||
'Pic5',
|
||||
'Pic6',
|
||||
'Pic7',
|
||||
'Bonus'
|
||||
]);
|
||||
|
||||
module.exports = SlottyItem;
|
||||
```
|
||||
|
||||
**Note**: Item names are defined using the texture asset names, not the symbol names received from the server response.
|
||||
|
||||
|Asset's name | Server Response |
|
||||
|-------------|-----------------|
|
||||
| Pic1 | PIC1 |
|
||||
| Pic2 | PIC2 |
|
||||
| Pic3 | PIC3 |
|
||||
| Pic4 | PIC4 |
|
||||
| Pic5 | PIC5 |
|
||||
| Pic6 | PIC6 |
|
||||
| Pic7 | PIC7 |
|
||||
| Bonus | BONUS |
|
||||
|
||||
For example, if the server returns a symbol named **BONUS**, the game should display the **Bonus** asset.
|
||||
|
||||
To establish this mapping, use the following configuration script:
|
||||
|
||||
```jsx title="assets/game-assets/scripts/configs/extend-hyper-gaming-config.js"
|
||||
var HyperGamingConfig = require('hyper-gaming-config');
|
||||
var SlottyItem = require("slotty-item");
|
||||
|
||||
HyperGamingConfig.itemMapper['BONUS'] = SlottyItem.Bonus;
|
||||
HyperGamingConfig.itemMapper['PIC1'] = SlottyItem.Pic1;
|
||||
HyperGamingConfig.itemMapper['PIC2'] = SlottyItem.Pic2;
|
||||
HyperGamingConfig.itemMapper['PIC3'] = SlottyItem.Pic3;
|
||||
HyperGamingConfig.itemMapper['PIC4'] = SlottyItem.Pic4;
|
||||
HyperGamingConfig.itemMapper['PIC5'] = SlottyItem.Pic5;
|
||||
HyperGamingConfig.itemMapper['PIC6'] = SlottyItem.Pic6;
|
||||
HyperGamingConfig.itemMapper['PIC7'] = SlottyItem.Pic7;
|
||||
```
|
||||
|
||||
## Slot Setting
|
||||
|
||||
There are two settings that determine the betting method used in the game:
|
||||
|
||||
- **TypeBetConfig**: this defines the bet calculation method. The available options are:
|
||||
- Way
|
||||
- Line
|
||||
- BetOptions
|
||||
- Dynaways
|
||||
- **TypePayline**: this setting determines which text label is displayed in the game's UI. Each type corresponds to a different label:
|
||||
| Type | Text Message |
|
||||
|---------|----------------|
|
||||
|Way | BET PER WAY |
|
||||
|Line | BET PER LINE |
|
||||
|BaseBet | PLAY MULTIPLIER|
|
||||
|
||||
Depending on the requirements of your game, you can customize both Payline and BetConfig by adding the following script:
|
||||
|
||||
```jsx title="assets/game-assets/scripts/slotty-settings/extend-slotty-setting.js"
|
||||
var BaseSlottySetting = p4fslot.require('slotty-setting');
|
||||
var SlottyItem = require('slotty-item');
|
||||
var SlottyParameter = p4fslot.require('slotty-parameter');
|
||||
|
||||
BaseSlottySetting.prototype._getDefaultTypePayline = function () {
|
||||
return SlottyParameter.TypePayline.Line;
|
||||
};
|
||||
|
||||
BaseSlottySetting.prototype._getDefaultTypeBetConfig = function () {
|
||||
return SlottyParameter.TypeBetConfig.Line;
|
||||
}
|
||||
```
|
||||
|
||||
## Default Slot Item Pattern
|
||||
|
||||
When the game is opened, the reel panel should display a **default pattern** that contains no possible win lines.
|
||||
|
||||
For instance, the following item pattern should not be used, as it contains two win lines:
|
||||
|
||||

|
||||
|
||||
To keep the gameplay experience fresh, the displayed pattern should be selected randomly each time. At a minimum, three non-winning patterns should be available.
|
||||
|
||||
To configure these patterns, add the following method to your **extend-slotty-setting** script:
|
||||
|
||||
```jsx title="assets/game-assets/scripts/slotty-settings/extend-slotty-setting.js"
|
||||
BaseSlottySetting.prototype._getPatternNotWin = function () {
|
||||
return [
|
||||
[SlottyItem.Pic5, SlottyItem.Pic3, SlottyItem.Pic5, SlottyItem.Pic1, SlottyItem.Pic5,
|
||||
SlottyItem.Bonus, SlottyItem.Pic6, SlottyItem.Pic5, SlottyItem.Pic1, SlottyItem.Pic5,
|
||||
SlottyItem.Pic2, SlottyItem.Pic6, SlottyItem.Pic2, SlottyItem.Pic1, SlottyItem.Pic2
|
||||
],
|
||||
[SlottyItem.Pic4, SlottyItem.Pic7, SlottyItem.Pic2, SlottyItem.Pic5, SlottyItem.Pic7,
|
||||
SlottyItem.Pic4, SlottyItem.Pic7, SlottyItem.Pic6, SlottyItem.Pic5, SlottyItem.Pic7,
|
||||
SlottyItem.Pic7, SlottyItem.Pic3, SlottyItem.Bonus, SlottyItem.Pic2, SlottyItem.Pic3
|
||||
],
|
||||
[SlottyItem.Pic1, SlottyItem.Pic2, SlottyItem.Pic3, SlottyItem.Pic7, SlottyItem.Pic3,
|
||||
SlottyItem.Pic2, SlottyItem.Pic7, SlottyItem.Pic4, SlottyItem.Pic3, SlottyItem.Pic2,
|
||||
SlottyItem.Pic1, SlottyItem.Pic7, SlottyItem.Pic4, SlottyItem.Pic3, SlottyItem.Bonus
|
||||
]
|
||||
];
|
||||
};
|
||||
```
|
||||
|
||||
The results of those 3 patterns are shown below:
|
||||
|
||||
| Pattern 1 | Pattern 2 | Pattern 3 |
|
||||
|---------------------------------|---------------------------------|---------------------------------|
|
||||
||||
|
||||
|
||||
## Hyper Gaming Integration
|
||||
|
||||
The Slot Core supports both SmartFox and Hyper Gaming connections. For Hyper Gaming, we integrate specific modules using the DIContainer.
|
||||
|
||||
To connect and interact with the Hyper Gaming server, we need to register two key modules:
|
||||
- **hyper-gaming-config**: manages the connection configuration for the Hyper Gaming server.
|
||||
- **hyper-gaming-server-handler**: handles request and response data for game-server communication.
|
||||
|
||||
To register these, add the `_registerInjection` function in `extend-slotty-setting.js`:
|
||||
|
||||
```jsx title="assets/game-assets/scripts/slotty-settings/extend-slotty-setting.js"
|
||||
SlottySetting.prototype._registerInjection = function () {
|
||||
DIContainer.Register('serverConfig', require('hyper-gaming-config'));
|
||||
DIContainer.Register('serverHandler', p4fslot.require('hyper-gaming-server-handler'));
|
||||
};
|
||||
```
|
||||
|
||||
In addition to server modules, all Hyper Gaming projects should initialize the following handlers for sound, hotkey and UI interaction.
|
||||
|
||||
In the same `extend-slotty-setting.js`, add this function:
|
||||
|
||||
```jsx title="assets/game-assets/scripts/slotty-settings/extend-slotty-setting.js"
|
||||
var HyperSoundHandler = require('extend-sound-handler');
|
||||
var UISoundHandler = require('ui-sound-handler');
|
||||
var HyperHotkeyHandler = require('hyper-hotkey-handler');
|
||||
var HyperNotificationHandler = require('hyper-notification-handler');
|
||||
|
||||
SlottySetting.prototype._initializeParameter = function () {
|
||||
new UISoundHandler();
|
||||
new HyperSoundHandler();
|
||||
new HyperHotkeyHandler();
|
||||
new HyperNotificationHandler();
|
||||
};
|
||||
```
|
25
docs/02-setup-main-game/02-preview-scene.md
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Preview Scene
|
||||
|
||||
The login simulator scene allows you to run the game using a session account during development, enabling easier testing and debugging.
|
||||
|
||||
This scene includes a `login-hyper-gaming` object used to establish a connection with a running environment of your choice.
|
||||
|
||||

|
||||
|
||||
Available environments:
|
||||
|
||||
- **DEMO** : similar to [ https://gaming-world.joker88.club/]( https://gaming-world.joker88.club/). This environment uses a demo account, so no login is required. Some features are disabled, but the outcome feature is enabled, allowing you to select specific outcomes for testing purposes.
|
||||
- **SAT** : similar to [http://fns.joker88.club/] (http://fns.joker88.club/). This environment requires a valid account to log in. Except for the outcome feature, all other features are enabled, including replay and resume functionality.
|
||||
- **LOCAL** : Use this only if other environments are unavailable. By manually setting up session data, you can run the game locally. Not recommended for regular use.
|
||||
|
||||
To use preview scene, simply choose an Enviroment and put in the Game ID, then save the scene.
|
||||
|
||||
:::tip
|
||||
You should set the preview scene as a start scene in `Project Setting`. With that, no matter which scene your are on, when the game starts, it will always load preview scene first.
|
||||
|
||||

|
||||
:::
|
64
docs/02-setup-main-game/03-preload-scene.md
Normal file
@ -0,0 +1,64 @@
|
||||
---
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
# Preload Scene
|
||||
|
||||
The Preload Scene is where you define which assets will be downloaded **before** and **after** the game starts.
|
||||
|
||||
Setting up the preload system involves several steps, depending on the types of assets and specific download requirements.
|
||||
|
||||
Check out the [Game Assets Structure](./) for more detail.
|
||||
|
||||
## Preload vs Postload
|
||||
|
||||
Hyper Slot Game uses a two-stage loading process:
|
||||
- **Preload**: Downloads essential assets before the game scene is displayed. These typically include the background, text elements, and static textures.
|
||||
- **Postload**: Downloads additional assets in the background after the scene has been loaded. This usually includes animations. While these assets are downloading, static frame texture are shown in place of the actual animations. Once the download is complete, the animations seamlessly replace the static frame.
|
||||
|
||||
| Preload | Postload |
|
||||
|--------------------------------------|---------------------------------|
|
||||
|  |  |
|
||||
|
||||
Preload and postload assets are organized by scene.
|
||||
|
||||
For example, before loading the **Main Scene**, its preload assets are downloaded first. After the scene is displayed, the postload assets begin downloading in the background.
|
||||
|
||||
The same process applies to other scenes such as **Gamble**, **Free Game**, and **Bonus**.
|
||||
|
||||
## Platform Assets
|
||||
|
||||
Hyper Slot Game runs on both Web Desktop and Web Mobile platforms. While the UI and textures appear visually similar across both, the actual assets differ due to platform-specific optimization requirements.
|
||||
|
||||
Typically, the mobile version uses smaller-sized texture assets to reduce memory usage and improve performance.
|
||||
|
||||
| Assets | Desktop Size | Mobile Size |
|
||||
|-----------------------|---------------|--------------|
|
||||
| Symbol Bonus Animation| 1024x2048 | 1024x1024 |
|
||||
| Bigwin Spine Animation| 512x1024 | 358x717 |
|
||||
|
||||
As a result, when the game detects a mobile device, it will automatically download a different set of optimized assets tailored for that platform.
|
||||
|
||||
## Localize Assets
|
||||
|
||||
Hyper Slot Game supports localization through both text and raw asset replacements, with English as the default language.
|
||||
|
||||
Based on the selected language configuration, the game will download the corresponding localized assets instead of the default English versions.
|
||||
|
||||
| Assets | EN | ZH | TH |
|
||||
|-----------------------|---------------|--------------|----|
|
||||
| Text Buy Bonus |  |  | |
|
||||
|
||||
## Setting Up the Preload Scene
|
||||
|
||||

|
||||
|
||||
To set up the Preload Scene, simply open the scene and run the **preload-hyper** command from the **P4F Editor** package.
|
||||
|
||||
The available commands are:
|
||||
- **Load Message**: Scans the working directory for any text message files and loads them into the `game-message` component.
|
||||
- **Load Localize**: Detects all available language options and loads the corresponding localized assets into the `localization` component.
|
||||
- **Load Preload Assets**: Defines preload and postload assets, then loads them into the `p4f-scene-manager` component of the `scene-manager` node.
|
||||
- **Load Assets By Platform**: Scans for mobile-specific assets (used when the game runs on mobile devices) and loads them into the `platform-asset-manager` component.
|
||||
- **Load Sound**: Scans for background music and sound effects (SFX) and loads them into the `sound-controller`.
|
||||
- **Load All Above**: Executes all of the above commands in sequence.
|
17
docs/02-setup-main-game/_category_.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"position": 2,
|
||||
"label": "Setup Main Game",
|
||||
"collapsible": true,
|
||||
"collapsed": false,
|
||||
"link": {
|
||||
"type": "generated-index",
|
||||
"title": "Setup Main Game",
|
||||
"description": "This section will guide you through the process of setting up the main game logic and structure.",
|
||||
"keywords": [
|
||||
"setup",
|
||||
"main game",
|
||||
"game logic",
|
||||
"structure"
|
||||
]
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 27 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 18 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 510 KiB |
After Width: | Height: | Size: 15 KiB |
After Width: | Height: | Size: 69 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 131 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 71 KiB |
After Width: | Height: | Size: 74 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 164 KiB |
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 129 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 94 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 170 KiB |
After Width: | Height: | Size: 368 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 79 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 114 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 63 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 56 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 65 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 62 KiB |