Micro-letter game for volume navigation component that supports cloud model two-dimensional code Jump!

Micro-letter game for the amount Cocos Creator program is designed to help game developers with each other for volume, open a "B game" Portal from "A game" leading to improved visibility and user activity game.

"Creator Planet game development community," the public number and "smile games" public numbers as well as its "smile box" micro-channel small program jointly provides a simple and easy game navigation controls to Cocos Creator game developers, currently supports three major mode 5 type scenarios:

  1. Local Mode
  2. Cloud micro-channel mode
  3. Smile mode

The following is the test results on several uses micro message:
file

Under explain in detail the specific use navigation controls.

01 local mode

Local mode most simple, simply GameNavigator preform dragged into the scene, enter appid can be used. In the absence of any server support, you need to jump game icon to save the project and set about on their own, as shown below:
file

Appid also require the game to fill the micro-channel profile game.json file, as shown in the following code:

{
    "deviceOrientation": "portrait",
    "networkTimeout": {
      "request": 5000,
      "connectSocket": 5000,
      "uploadFile": 5000,
      "downloadFile": 5000
    },
    "subpackages": [],
    "navigateToMiniProgramAppIdList": [
        "wx8ee2e9bead348dfa",
        "wxcaa2fc5e0e4d4e4c",
        "wx723627b94b2611ca",
        "wxdbbab1b26ac80510",
        "wx28adee02aa5bebbe"
    ]
}

In the micro-channel game, we want to jump directly to the game must be appid fill in the navigateToMiniProgramAppIdList inside the array, this approach I call "beating."

Do not fill the array of games how to do it? Do not worry, we will later introduce a technique called "second-order jump" approach.

02 micro-channel cloud model

Micro-channel cloud model is a small game using the micro-channel cloud development, will need to jump to save game information to the micro-channel cloud database, using exactly the same way as a local mode, this mode is not set game icon and the name of the game.

Cloud micro-channel provided

Using micro-channel cloud model, you create a set named "gameInfos" data in the cloud, as shown below:
file

Currently each game record data structure is as follows:

{
    appid: String,   //游戏appid
    name:  String,   //游戏显示名字
    icon:  String,   //游戏显示图标
        bg: String,       //游戏二维码
}

The above icon is an icon of the game URL address, you can upload images to cloud storage micro letter, paste the link here.

Shawn will provide the full story project, the project has a collection of tables gameInfos data backup, you can also import directly above make additions and changes.

Client Settings

After the game data is configured in the micro-letter cloud, customers also need to set the project in a letter about your micro cloud name, find wxconfig.js file, modify the contents of the figure below env field:

file

env is your current corresponding micro-channel cloud environment, a micro-channel support two small games default environment, it can be used to develop a test for a publication on-line environment. Open letter micro cloud, click the Settings button on the top menu you can see:

file

Use the controls

Micro-channel is still used GameNavigator cloud model components, the Type property to WX_GAME, look:

file

Game information stored on the server, so there will be a data download, the process of loading icon when the icon has not been displayed, there will be a small rotating animation!

Micro-channel cloud model also supports random appid way, when you specify appid does not exist in your micro-channel cloud database, it will show a random game to, so you do not set appid also possible.

03 Smile mode

Smile mode is provided by the game information box smile, smile boxes currently has supported dozens of micro-channel games, and while there is also included a game of two-dimensional code that supports our ability to "jump the second order," the front said, the figure is smiling box small micro-channel program interface:

Micro letter backstage settings

First I want to add "Smile game" domain name in the micro-channel game background "Development settings", see figure below:
file

After setting request security domain, probably need about 1 minute into force in the game, then you can directly use GameNavigator navigation components, and usage is no different, specified appid like.

Upload Game information

GameNavigator component property to SARS_GAME, SARS stands for "smile and remain smile" instead of Sars SARS virus!

Currently, "Smile game" temporarily does not support random game loads, you must provide a "smile box" included the game appid job. At the same time, "smiled the game" on the number of public offers developers upload their own little game information tool, look:

file

Assistant smile into the game game game input information provided by id, name, icon, two-dimensional codes.

Second-order jump

Here repeat what second-order jump when we do not set the game to jump to the micro-letter game.json profile, smiling through the game contains a two-dimensional code, we can in the game by pressing a small two-dimensional code recognition Jump to see the demo video below:

https://v.qq.com/x/page/c3000cefbkt.html

Can easily achieve any game of jump through "second-order jump", currently in the micro-channel cloud model also supports the "second-order jump" mode, you can easily jump through the game server control.

Epilogue

Finally, let's look at the structure of engineering resources, see below:

file

Navigation controls all the resources are in the assets / game-legends catalog:

  1. GameNavigator preform prefabs directory that is above explain the game navigation controls;
  2. SarsGameHelper scripts directory is provided to the game data acquired smiling package, and a preview of the two-dimensional code; wxconfig micro channel is initialized and the micro-channel cloud environment configuration cloud database.
  3. textures directory GameNavigator controls the use of image resources

The outermost layer of the test-game-navigator test scenarios, which demonstrates more than 3 game loading, five kinds of use.

Currently micro-channel game is individual developers, one of the most feasible through technical realization of the way. But most small game After a beta test phase, the daily income between about 0 to 5 yuan, very embarrassing. Shawn little hope that more game developers, can be hand in hand together more exchanges, more communication, adding more game exposure opportunity to guide the user through each other, which is currently Shawn could think to do!

Large holiday is a good time for small game exposure, Shanw planned before the October 1 National Day, will change the paradigm Github project submitted to full liberalization, there is hope that we will be able to get a good result!

Thank you for your support, public attention reply [No.] available for volume navigation source project.

file

Guess you like

Origin www.cnblogs.com/creator-star/p/11589766.html