add set up main game

This commit is contained in:
luyen.vo 2025-04-23 16:20:38 +07:00
parent 5d10c7a3ac
commit 9e36bd7e68
106 changed files with 121 additions and 73 deletions

View File

@ -2,9 +2,9 @@
sidebar_position: 3
---
# Set Custom Cocos Engine
# Setup Custom Cocos Engine
Link project to a custom Cocos Engine.
Set **Javascript Engine Path** 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.

View File

@ -2,7 +2,7 @@
sidebar_position: 1
---
# Adding Game Configuration
# 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.
@ -55,7 +55,7 @@ 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");
var SlottyItem = require('slotty-item');
HyperGamingConfig.itemMapper['BONUS'] = SlottyItem.Bonus;
HyperGamingConfig.itemMapper['PIC1'] = SlottyItem.Pic1;
@ -147,7 +147,9 @@ To connect and interact with the Hyper Gaming server, we need to register two ke
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 () {
var DIContainer = p4fcore.require('di-container');
BaseSlottySetting.prototype._registerInjection = function () {
DIContainer.Register('serverConfig', require('hyper-gaming-config'));
DIContainer.Register('serverHandler', p4fslot.require('hyper-gaming-server-handler'));
};
@ -158,12 +160,12 @@ In addition to server modules, all Hyper Gaming projects should initialize the f
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 HyperSoundHandler = require('sound-handler');
var UISoundHandler = require('ui-sound-handler');
var HyperHotkeyHandler = require('hyper-hotkey-handler');
var HyperNotificationHandler = require('hyper-notification-handler');
SlottySetting.prototype._initializeParameter = function () {
BaseSlottySetting.prototype._initializeParameter = function () {
new UISoundHandler();
new HyperSoundHandler();
new HyperHotkeyHandler();

View File

@ -12,8 +12,8 @@ This scene includes a `login-hyper-gaming` object used to establish a connection
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.
- **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.

View File

@ -8,7 +8,7 @@ The Preload Scene is where you define which assets will be downloaded **before**
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.
Check out the [Game Assets Structure](../category/game-asset-structure) for more detail.
## Preload vs Postload
@ -46,7 +46,7 @@ Hyper Slot Game supports localization through both text and raw asset replacemen
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|![Buy Bonus EN](./img/title-buy-bonus.png)|![Buy Bonus ZH](./img/title-buy-bonus_zh.png)|![Buy Bonus TH](./img/title-buy-bonus_th.png)|
## Setting Up the Preload Scene

View File

@ -0,0 +1,55 @@
---
sidebar_position: 4
---
# Loading Scene
This is where the actual preload asset downloading begins, accompanied by a progress bar to indicate loading status.
In addition to loading assets, Hyper Slot Game also uses this scene to showcase the games main features through in-game advertisements.
![Loading Roma Legacy](./img/loading-roma-legacy.png)
## Loading Hyper vs New Loading Hyper
In Hyper Slot games, there are 2 styles of loading scene:
- **loading-hyper**: The default loading setup. Displays all advertising features on a single screen, with an option to automatically launch the game once all preload assets are downloaded.
- **new-hyper-loading**: A newer loading style that presents advertising features in a paginated layout. This version does not include an option to start the game automatically.
| loading-hyper | new-loading-hyper |
|-------------------------------------------------------|-----------------------------------------------------------------|
|![loading-hyper](./img/hyper-loading-lucky-rooster.png)|![new-loading-hyper](./img/new-hyper-loading-gates-of-wealth.png)|
## Setup loading scene
To set up the loading scene, use the appropriate command from the `P4F Editor` package: `loading-hyper` or `new-loading-hyper`, depending on your requirements.
![Loading Hyper](./img/hyper-loading.png) ![New Loading Hyper](./img/new-hyper-loading.png)
Running either command will generate a complete loading scene, including both landscape and portrait layouts.
Once the scene is generated, you can customize it by positioning UI elements and assigning the appropriate assets.
![Loading Node Tree](./img/loading-node-tree.png)
One of the best features of these commands is that they can also automatically load all required assets for the loading scene.
If you run the command without setting up the assets, youll see an empty loading scene like this:
![Loading Raw Scene](./img/loading-raw-scene.png)
However, with a proper asset setup, the loading scene will appear fully populated, like this:
![Loading Full Assets Scene](./img/loading-full-assets-scene.png)
:::info
For detailed guidelines on how to set up loading assets, refer to the [Game Asset Structure](../category/game-asset-structure) manual.
:::
:::tip
For testing purposes, you dont need a full asset setup. \
Just set up the ***btn-start*** node in the Node Tree and youre good to go.
![Loading Button Setup](./img/loading-button-setup.png)
:::

View File

@ -0,0 +1,26 @@
---
sidebar_position: 5
---
# Main Scene
This is where all the magic happen.
Main scene is the most complicated scene with hundreds of object, script and config.
![Main Scene Wireframe](./img/main-scene-wireframe.png)
Yet it is suprisingly simple to use.
By following step by step setup, you'll have a working main scene in no time.
:::info
In fact, if all of the other scenes are setup properly, you can even run test the game without any setup on main scene.
Try to run the project, you'll the result as below. It doesn't look like much but it is actually a game running without visual assets.
![Run Test](./img/run-test.png)
:::
## Setup Reel Slot

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Some files were not shown because too many files have changed in this diff Show More