Home  >  Article  >  WeChat Applet  >  Let's take a look at the things to note when developing mini programs and mini games.

Let's take a look at the things to note when developing mini programs and mini games.

coldplay.xixi
coldplay.xixiforward
2021-04-19 11:15:042541browse

Let's take a look at the things to note when developing mini programs and mini games.

Today I studied mini game development and summarized some of the problems I encountered:

1. Register appId

Mini games developed with mini programs are not the same appId as other projects developed with mini programs

If your current mini program account has been If you choose another category (non-game), then you need to register another account to apply for the mini-game appId separately. The steps are the same as when you register for other categories. When selecting the category, just select the game ( Must reapply, there is no game item in the account that has already been registered in other categories)

Related free learning recommendations: WeChat Mini Program Development

## 2. Adapter

小游戏Development language is still javascript, but because the running environment of the mini program does not have DOM and BOM , that is, there are no document and window objects. At this time, WeChat Revolving Door encapsulates a js file weapp-adapter.js for mini program development (actually it is the adaptation layer of the API that simulates DOM and BOM ), which is called Adapter, can be found at: https://developers.weixin.qq.com/minigame/dev /tutorial/base/adapter.html,At the same time, the Adapter also serves as the game engine adaptation layer, so that small games based on ## can be used #HTML5 game engine

                                                                   

On-screen canvas and off-screen canvas, on-screen means that it can be seen at a glance on the screen The picture is invisible off-screen.

Weapp-adapter.js has automatically created an on-screen canvas, so we can create it ourselves as an off-screen canvas.

4. Image loading

##Image loading The path must be an absolute path starting from the project root directory

5. Audio support

Currently, the only audio formats supported by IOS and Android are mp3, aac, and wav. Due to system limitations, the maximum number of simultaneous playbacks on Android is mp3, aac, and wav. 10 audios

#6. File

1. Code package file: a file added to the project root directory. The access method of the file is to write the file path starting from the project root directory. Supports relative path writing.

2. Local files: Files that need to be stored (Locally generated by calling the interface or downloaded from the network), Local files refer to What is important is that after the mini program is added to the mobile phone by the user, there will be an independent file storage area, isolated in the user dimension. That is, on the same mobile phone, each WeChat user cannot access the files of other logged-in users, and the files between different appIds of the same user cannot access each other.

##             Temporary (memory size is not limited)

## User (50MB)

                                                                                                                                                                                                                            7. Mini-game opening capabilities and API

##8. Mini Game Opening Tool

Related free learning recommendations: WeChat Mini Program Development Tutorial

The above is the detailed content of Let's take a look at the things to note when developing mini programs and mini games.. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete