Commit ad05737d authored by liujiangnan's avatar liujiangnan

feat: 上报成绩

parent c7a039ff
import { onHomeworkFinish } from "../script/common/util";
/** /**
* 游戏主逻辑 * 游戏主逻辑
*/ */
...@@ -160,6 +162,8 @@ var game = cc.Class({ ...@@ -160,6 +162,8 @@ var game = cc.Class({
this.playCatDragon("finish") this.playCatDragon("finish")
this._timeoutIds.push(setTimeout(() => { this._timeoutIds.push(setTimeout(() => {
LWD_3.speaker.inst.playEffect(LWD_3.enum.E_Audio.CatComplete); LWD_3.speaker.inst.playEffect(LWD_3.enum.E_Audio.CatComplete);
// TODO 结束游戏,上报成绩
onHomeworkFinish();
}, 500)); }, 500));
}, },
......
...@@ -226,4 +226,13 @@ async function rabbonFall(node) { ...@@ -226,4 +226,13 @@ async function rabbonFall(node) {
const offsetX = RandomInt(-200, 200) * time; const offsetX = RandomInt(-200, 200) * time;
await asyncTweenBy(node, time, { x: offsetX, angle: offsetX * 60 / 200 }); await asyncTweenBy(node, time, { x: offsetX, angle: offsetX * 60 / 200 });
rabbonFall(node); rabbonFall(node);
}
export function onHomeworkFinish(callback = null, data = null) {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
middleLayer.getComponent('middleLayer').onHomeworkFinish(callback, data);
} else {
console.log('onHomeworkFinish');
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment