Using Cocos Creator to Develop WeChat Mini Games (1) - Project Configuration and Environment Construction

Project configuration and environment construction

The first time I opened the Cocos Creator interface, I felt that this is very Unity. Although there are many areas that have not been perfected, it is enough for developing lightweight games such as small games, so students who have used Unity will get started. Very fast. This tutorial will also take care of newbies who have never used Unity, so don't worry~

The first step of environment configuration CocosCreator

This is the official website of Cocos Creator , click to download the installer that suits you, then install it, and then open Cocos Creator to create a project.
create process

Cocos Creator provides different templates in it, the HelloWorld template is jswritten using, if you want to use typescriptit, you can create the following TypeScript HelloWorld template.

The second step of environment configuration installs additional tools

Open Preferences to set the path to the required tools.
write picture description here
Install WeChat Developer Tools
first and then install Apache Ant

Fill in the installation directory to the corresponding path option. The WeChat developer tool is a tool officially provided by WeChat, on which you can preview the operation of the mini-game, or upload it to the server, and then preview it on your mobile phone. Apache Ant is used for local preview, and it is used more often.

The third step of environment configuration is to build and run

Click the project construction and release button, and check the release platform as Wechat Game . Note : The Appid is a temporary ID, and it needs to be replaced with the ID you applied for when it is actually released. This is the application website .
write picture description here

Then click Build and wait for its Complete.
write picture description here
Then click Run , it will jump to the WeChat developer tool.

The fourth step of environment configuration is to use the WeChat developer tool to preview the mini game

Select Mini Program....
write picture description here
If there is a mini game you published before in the project, click it, if not, press the + sign in the lower right corner to add it
write picture description here

After clicking the preview button, a QR code will be generated, scan it with your WeChat, and you can preview it on the real machine
write picture description here

The following is the generated QR code, just scan it (this QR code has an effective time, and it cannot be used after the effective time)
write picture description here

The complete long-winded publishing tutorial is over. If you have any questions, please leave a message~

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325857083&siteId=291194637