CocosCreator实现左右跳游戏JumpLR.zip
CocosCreator实现左右跳游戏JumpLR.zip const {ccclass, property} = cc._decorator; @ccclass export default class Box extends cc.Component { @property(cc.Label) txtNum: cc.Label = null; private mPrevBox: cc.Node = null; private mNextBox: cc.Node = null; private mOffset: number = 0; // [-4,4] // LIFE-CYCLE CALLBACKS: // onLoad () {} start () { } // update (dt) {} setOffset(offset: number){ this.mOffset = offset; } getOffset(){ return this.mOffset; } setPrev(prev: cc.Node){ this.mPrevBox = prev; } getPrev(){ return this.mPrevBox; } setNext(next: cc.Node){ this.mNextBox = next; } getNext(){ return this.mNextBox; } setNum(num: number){ this.txtNum.string = `${num}`; } down(y: number){ this.node.runAction(cc.sequence( cc.moveBy(0.4, 0, y), cc.callFunc( () => { NodeMgr.putBox(this.node); }) )); } }
文件列表
JumpLR.zip
(预估有个69文件)
jsconfig.json
280B
project.json
60B
assets
resources.meta
137B
resources
ani
move.anim.meta
88B
move.anim
371B
texture.meta
137B
texture
暂无评论