Commit 089e2235 authored by Tt's avatar Tt

修改结算和显示内容

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