Game Developer

Slotty Core

Guideline


  1. Clone git repository and create new project
  1. CREATE NEW PROJECT GAME SLOTTY

Step 1: Clone repository at  http://git.mecury.com.vn:7990/projects/COCCOR, using software SourceTree

Step 2: Create an empty Cocos project. Set location to any path beside the one from repository (since Cocos doesn’t allow creating project on a non-empty folder)


Step 3:  Add core slotty and template game slotty

Core game consists of many submodules:

These are commands for submodules of sound, dialog, coin shower for game chinese style:

These are commands for submodules of sound, dialog, coin shower for game international style:


Step 4: Set up custom Cocos engine for new project


Step 5: Set up game-assets folder

  1. ASSETS
  1. File naming convention

        Some special case must follow 

  1. Folder structure  of raw assets

  1. Asset folder path

  1. Custom scale

Platform

Normal Scale

Optimized Scale

Desktop

1

0.75

Mobile

0.7

0.58


  1. Pack asset



Press button Publish sprite sheet to begin packing process. When it is done, the dialog should notify that the process is completed. There should be a plist and a png appear in the folder according to the Data file path described above        

NOTE: After packing ALL assets into atlases, we open the project to config data for new assets to use in-game.

_ Custom scale data: Choose menu P4FEditor > asset-manager > Generate Custom Scale

_ Merge Json Files: Choose menu P4FEditor > asset-manager > Merge Json Files

_ Remove Packable Texture: Choose menu P4FEditor > asset-manager > Remove Packable Texture

_Compress Texture: Choose menu P4FEditor > asset-manager > Compress Texture Format


  1. SCENES: 
  1. Preview scene

  1. Preload scene


 

  1. Loading scene

        


\



 

_ File image1.tps:

_ File loading-background.tps: If all asset dont have transparent, we should pack atlas with type JPG, and quality = 100

_ File loading.tps: includes assets in folder loading and loading-extra

After packing assets, we open scene loading. Choose menu P4F Editor > loading-hyper >  Create Loading 2 / 3 Items For New Games

 

                

  1. Normal spin on  MAIN SCENE

_ File pop-up-panel.tps:

+Data file:
        ….
/assets/game-assets/textures/{v}/preloads/main-game/custom-scale/pop-up-panel.plist

+Scaling variants: normal scale. Popup panel only displays on desktop, so we only pack for desktop:

 


_ Set up popup panel.

_And then deactivate node content in node popup-panel/hyper-confirm-dialog



_ File background.tps for desktop:

+Sprites: only image background use for desktop

+Data file:
        ….
/assets/game-assets/textures/{v}/preloads/main-game/background-main-game.plist

+Scaling variants: optimized scale. Atlas  only displays on desktop, so we only pack for desktop:


_ File background-mobile.tps for mobile:

+Sprites: include 2 images background use for landscape and portrait scene

+Data file:
        ….
/assets/game-assets/textures/{v}/preloads/main-game/background-main-game.plist

+Scaling variants: optimized scale. Atlas  only displays on mobile, so we only pack for mobile:


_ Use sprite background of desktop for 2 node background-container/background and gamble-loader/background-container/gamble-background-landscape


_ Use sprite background-portrait of mobile for 2 node mobile-background-portrait/node/ background and gamble-loader/background-container/ gamble-background-portrait


_ Prepare raw asset and pack atlas

+ Raw asset: Path ….\raw-assets\textures\main-game-ui\spin-panel


+ Pack atlas

Data file: …./assets/game-assets/textures/{v}/preloads/main-game/spin-panel.plist

Scaling variants: Optimized Scale


_ Drag sprite frame spin-panel-frame in atlas spin-panel.plist to node Canvas/main-view/game-view/spin-panel-frame/frame


_ Step 1: Add script config for spin-panel

+ Create script slotty-item.js in folder assets/game-assets/scripts/slotty-data. Add code to init enum items. NOTE: SlottyItem.Wild and SlottyItem.Scatter was registered in core, so we don’t register again.

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;

+Create script extend-slotty-setting.js in folder assets/game-assets/scripts/slotty-settings. Add code to config type pay line , and pattern not win

var DIContainer = p4fcore.require('di-container');

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._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

        ]

    ];

};

_ Step 2: Set sprite of symbols in Canvas/system/sprite-frame-provider by drag sprite frame of all symbols to array Sprite Frames


_ Step 3: Config reel-scroller-helper:

+ At node Canvas/main-view/game-view/spin-panel, set value for component reel-scroller-helper

+Cell Item Script Name: script attach for node cell-item


+ Scroller Script Name: script attach for node reel-scroller

+ Reel count and Row count: amount reel and row of spin panel

+ Cell Size: size of cell item

+ Cell Dim Color: color of image symbol on lose cell when show win line

+ Top Count, Bot Count: amount cell on top and bottom to fake scoll

_Step 4: Click checkbox Generate Panel to generate spin panel

_Step 5: Then, we will generate all other panels of spin panels: landing-panel, present-win-cell-panel, present-win-border-panel, tension-panel


+ landing-panel

+ present-win-cell-panel

+ present-win-border-panel

+tension-panel

Frame: Sprite frame of animation tension.

Size: Often equal size of a reel. Canvas/main-view/game-view/spin-panel/content/ reel-scroller-0


_ Prepare raw asset

+ Raw asset includes 2 parts: static image and text image. Path ….\raw-assets\textures\bottom-ui-desktop

_ Pack atlas

+ Data file: …./assets/game-assets/textures/{v}/preloads/main-game/spin-panel.plist

+ Scaling variants: Optimized Scale


  1. Scripting
  1. Config slotty setting, slotty item, server-handler
  2. Preview normal game