Your first WeChat mini-game, teaching you how to make mini-games from scratch (1)

1. Download WeChat developer tools and Cocos Creator

1. WeChat developer tools

WeChat Open Documentation

2.Cocos Creater

Cocos Engine_Game Development Engine

The release process is to first write your game in cocos, then generate the corresponding software package, and then upload it to the WeChat applet platform through the WeChat developer tools.

2. Develop games

Cocos is a typical component node development, the language before version 3.x can be js, ts. Only ts can be used after version 3.x.

Introduction · Cocos Creator Manual

3. Several functions released by WeChat mini-games

1. Add sharing

var id = '' // 通过 MP 系统审核的图片编号
var url = '' // 通过 MP 系统审核的图片地址
wx.shareAppMessage({
  imageUrlId: id,
  imageUrl: url
})

wx.onShareAppMessage(function () {
  return {
    imageUrlId: id,
    imageUrl: url
  }
})

2. Add ads

et bannerAd = wx.createBannerAd({
  adUnitId: 'xxxx',
  style: {
    left: 10,
    top: 76,
    width: 320
  }
})

bannerAd.show()

4. WeChat mini-games developed by myself

If you have any questions or suggestions, you can private message me. If friends want to learn more about WeChat mini games, I will continue to update the detailed production methods.

Guess you like

Origin blog.csdn.net/m0_57491181/article/details/128003385
Recommended