Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to write the code for Mini Program game development?

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Today, Xiaobian will share with you the relevant knowledge points on how to write the code of Mini programs game development. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you will gain something after reading this article. Let's find out together.

Install development tools

Go to the developer tools download page and download the corresponding installation package according to your operating system.

New Project Select Mini programs project, select the hard disk path where the code is stored. At present, Mini games do not provide public registration. Click to experience Mini games using AppID-free mode. Give your project a nice name. Finally, check "Create a quick game launch template"(note: you have to select an empty directory to have this option), click OK, and you have your first Mini games.

Click on the compile menu at the top to preview your first Mini games in the IDE.

Real Machine Preview

Click on the compile button on the tool to see the performance of this Mini games on the simulator interface on the left side of the tool. Click the preview button to experience your first Mini games on your phone by sweeping WeChat.

file structure

Mini games have only the following two required files:

├── game.js

└── game.json

game.js Mini games entry file

game.json Profile

configured

Mini games developers configure by writing a game.json file in the root directory. Developer tools and clients need to read this configuration to complete relevant interface rendering and attribute setting.

deviceOrientation Supported screen orientations

showStatusBar Whether to display status bar

networkTimeout Time out for network requests in milliseconds

networkTimeout.requestwx.request timeout in milliseconds

networkTimeout.connectSocketwx.connectSocket timeout in milliseconds

networkTimeout.uploadFilewx.uploadFile timeout in milliseconds

networkTimeout.downloadFilewx.downloadFile timeout in milliseconds

workers Multithreaded Worker configuration item, please refer to Worker documentation for details

deviceOrientation

value description

portrait

landscape

Example configuration {"deviceOrientation": "portrait","networkTimeout": {"request": 5000,"connectSocket": 5000,"uploadFile": 5000,"downloadFile": 5000}} The above is "How to write the code of Mini programs game development". Thank you for reading all the contents of this article! I believe everyone has a great harvest after reading this article. Xiaobian will update different knowledge for everyone every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report