Creator口红机实现lipstick_3.zip

所需积分/C币:16 2019-12-13 11:46:41 368KB ZIP
123
收藏 收藏
举报

Creator口红机实现lipstick_3.zip // Learn cc.Class: // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/class.html // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/class.html // Learn Attribute: // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html // - [English] http://docs.cocos2d-x.org/creator/manual/en/scripting/reference/attributes.html // Learn life-cycle callbacks: // - [Chinese] https://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html // - [English] https://www.cocos2d-x.org/docs/creator/manual/en/scripting/life-cycle-callbacks.html var DataMgr = require('DataMgr'); var LayerMgr = require('LayerMgr'); cc.Class({ extends: cc.Component, properties: { nodePlate: cc.Node, // 板子 nodeTouch: cc.Node, // 触摸节点 nodeLipstick: cc.Node, // 口红位置 prefabLipstick: cc.Prefab, // 口红预制 nodeLipstickContainer: cc.Node, // 总共有多少口红容器 }, // LIFE-CYCLE CALLBACKS: onLoad () { let mgr = cc.director.getCollisionManager(); mgr.enabled = true; // mgr.enabledDebugDraw = true; // mgr.enabledDrawBoundingBox = true; }, start () { this.nodeTouch.getComponent('Touch').setCallback( () => { this.onTouchCallback(); }); this.reloadUI(); this.startRun(); }, // update (dt) {}, startRun(){ // 顺时针转一圈,再逆时针转一圈,如此反复 this.nodePlate.stopAllActions(); this.nodePlate.rotation = 0; let seq = cc.sequence( cc.rotateBy(4, 360).easing(cc.easeIn(1.5)), cc.rotateBy(4, -360).easing(cc.easeIn(1.5)), ); this.nodePlate.runAction(seq.repeatForever()); }, /** * @description: 点击屏幕回调 * @param {type} * @return: */ onTouchCallback(){ // 口红用完了 if(DataMgr.leftLipstick <= 0){

...展开详情
立即下载 身份认证后 购VIP低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
  • 签到新秀

关注 私信
上传资源赚钱or赚积分
最新推荐
Creator口红机实现lipstick_3.zip 16积分/C币 立即下载
1/0