CocosCreator实现左右跳游戏JumpLR.zip

时间:2023-01-02 03:59:19
【文件属性】:

文件名称:CocosCreator实现左右跳游戏JumpLR.zip

文件大小:807KB

文件格式:ZIP

更新时间:2023-01-02 03:59:19

CocosCreator实现左右

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); }) )); } }


【文件预览】:
jsconfig.json
project.json
assets
----resources.meta(137B)
----resources()
--------ani()
--------texture.meta(137B)
--------texture()
--------scene()
--------prefab.meta(137B)
--------scene.meta(137B)
--------ani.meta(137B)
--------prefab()
----scripts()
--------Robot.ts(6KB)
--------BoxMgr.ts(7KB)
--------Home.ts(1KB)
--------NodeMgr.ts.meta(197B)
--------Box.ts.meta(197B)
--------NodeMgr.ts(1KB)
--------Game.ts(4KB)
--------Robot.ts.meta(197B)
--------Home.ts.meta(197B)
--------Game.ts.meta(197B)
--------BoxMgr.ts.meta(197B)
--------Box.ts(2KB)
----scripts.meta(137B)
settings
----services.json(7KB)
----project.json(666B)
----builder.json(973B)
.gitignore
creator.d.ts

网友评论