微信游戏小程序怎么禁止怎么关闭广告(微信游戏小程序怎么禁止怎么关闭不了)

文章目录

目录

?? 介绍

玩法截图

部分源码

完整源码链接

2014年Gabriele Cirulli利用周末的时间写2048这个游戏的程序,仅仅只是好玩而已。他想用一种不同的视觉展现效果和更快速的动画来创造属于自己的游戏版本。

每次可以选择上下左右其中一个方向去滑动,每滑动一次,所有的数字方块都会往滑动的方向靠拢外,系统也会在空白的地方乱数出现一个数字方块,相同数字的方块在靠拢、相撞时会相加。不断的叠加最终拼凑出2048这个数字就算成功。

这里通过微信小程序开发这这款小游戏

具体截图如下

部分源码

//app.js

const GLOBAL_DATA_SAVE_KEY = '__gloabl_data__'

App({

onLaunch: function() {

let data = wx.getStorageSync(GLOBAL_DATA_SAVE_KEY)

if (data) {

this.globalData = data

// console.log(this)

} else {

let that = this

wx.downloadFile({

url: 'https://fanqier.com/static/merge1.silk',

success(res) {

if (res.tempFilePath) {

that.globalData.merge = res.tempFilePath

wx.saveFile({

tempFilePath: res.tempFilePath,

success: function(res) {

that.globalData.merge = res.savedFilePath

wx.setStorage({ key: GLOBAL_DATA_SAVE_KEY, data: that.globalData })

console.log(res)

}

})

}

}

})

wx.downloadFile({

url: 'https://fanqier.com/static/move1.silk',

success(res) {

if (res.tempFilePath) {

that.globalData.move = res.tempFilePath

wx.saveFile({

tempFilePath: res.tempFilePath,

success: function(res) {

that.globalData.move = res.savedFilePath

wx.setStorage({ key: GLOBAL_DATA_SAVE_KEY, data: that.globalData })

console.log(res)

}

})

}

}

})

}

},

globalData: {

merge: '',

move: '',

}

})

完整项目资源链接:

搜索

2048小游戏微信小程序源码.rar-小程序文档类资源-CSDN文库

本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 sumchina520@foxmail.com 举报,一经查实,本站将立刻删除。
如若转载,请注明出处:https://www.yiheng8.com/143402.html