WeChat mini games sound very similar to WeChat mini programs, but there are important differences to understand. A mini game is NOT just a mini program which happens to be a game.
In fact, the Mini Program rules explicitly disallow game and quiz-type content in mini programs:
6.2. WeChat Mini Programs must also not contain any of the following content in violation of the platform rules:
6.2.3 Game or quiz type content.
If you want to develop a game, it must be developed as a mini game. Let's first look at the similarities between mini programs and mini games, and then discuss some differences.
Both mini programs and mini apps are hosted by Tencent - you upload your code and assets to their servers. This means that they can ensure the games run very fast using their content delivery network in China.
Both mini programs and apps require you to go through an approval process for the initial submission of the app as well as any updates. Don't expect to be able to use any kind of questionable content in your app!
There is a severe size limitation on mini programs and mini apps - they are limited to just 4MB. Of course you can download additional assets from another server, but that adds to the complexity of the code, and you will need to download the assets every time the app is launched.
From a technical perspective, mini programs use a trio of technologies:
- WXML - a proprietary Tencent markup language with various components you can use in your mini program
- WXSS - similar to CSS with some restrictions
Because of the use of the WeChat API and WXML, it's not at all easy to take an existing native app or web app and port it into a mini program.
Mini games are quite different. They use either a Canvas element, similar to the HTML <canvas> element in a browser, or WebGL. You can take an existing HTML5 web game written to use Canvas or WebGL and fairly easily port it to WeChat.
Because you can draw to the canvas/screen directly you have full control over the appearance of your game. Mini programs are also allowed to be landscape (whereas all mini programs are portrait).
As our team had familiarity with Cocos in previous game projects, it was a no-brainer to use Cocos as the game framework for our forthcoming mini game!