Commit 089e2235 authored by Tt's avatar Tt

修改结算和显示内容

parent 2c8465b9
This diff is collapsed.
......@@ -57,14 +57,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.event.clear();
courseware.onConfigurationLandscape()
// 下一页
const middleLayer = cc.find('middleLayer');
const middleLayerComponent = middleLayer.getComponent('middleLayer');
const { index, length } = middleLayerComponent.getPageInfo(); // 返回 length:有多少页; index: 当前第几页(从0开始)
if (index == length - 1) {
middleLayerComponent.goNextCross(); // 跳转到下一关卡
} else {
middleLayerComponent.goNextPage(); // 跳转到下一页
}
const middleLayer = cc.find('middleLayer').getComponent('middleLayer');
middleLayer.saveGolds(this.score); // 保存金币数量;num 是获得金币的数量,数字类型;
middleLayer.goNextPage(); // 跳转到下一页
// const { index, length } = middleLayerComponent.getPageInfo(); // 返回 length:有多少页; index: 当前第几页(从0开始)
// if (index == length - 1) {
// middleLayerComponent.goNextCross(); // 跳转到下一关卡
// } else {
// middleLayerComponent.goNextPage(); // 跳转到下一页
// }
}
onClose() {
this.onDestroy();
......@@ -119,9 +120,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.startQuestion();
}
private score: number;
gameOver() {
this.state = State.Over;
this.showAni().then(coin => {
this.showAni().then((coin: number) => {
this.score = coin;
pg.event.once('layer_coin_show_coin_end', () => {
this.onClose();
}) // 动画回调
......@@ -171,10 +174,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.aniBottomEnter().then(() => {
pg.hw.playAudio('readyGo', false, () => {
});
cc.tween(ready).to(1, { y: -50 }).to(0.2, { y: 0 }).delay(0.3).call(() => {
cc.tween(ready).to(1, { y: -50 }).to(0.2, { y: 0 }).to(0.3, { opacity: 0 }).call(() => {
ready.active = false;
}).start();
cc.tween(go).delay(1.3).to(1, { y: -50 }).to(0.2, { y: 0 }).delay(0.5).call(() => {
cc.tween(go).delay(1.3).to(1, { y: -50 }).to(0.2, { y: 0 }).delay(0.2).to(0.3, { opacity: 0 }).call(() => {
go.active = false;
resolve('');
}).start();
......@@ -209,7 +212,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.right = 0
this.gameStart = true;
this.state = State.Recording;
this.currentItemQuestion = this.createQuestionItem(cc.v2(0, 50));
this.currentItemQuestion = this.createQuestionItem(cc.v2(0, -100));
this.updateQuestion(this.currentItemQuestion, this.getCurrent());
this.updateProgress();
}
......
......@@ -28,8 +28,8 @@
"rawHeight": 238,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderLeft": 185,
"borderRight": 56,
"subMetas": {}
}
}
......
......@@ -28,8 +28,8 @@
"rawHeight": 238,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"borderLeft": 182,
"borderRight": 61,
"subMetas": {}
}
}
......
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