Commit 0fa4f01c authored by Tt's avatar Tt

效果调整

parent c3b52237
...@@ -21,13 +21,13 @@ export default class LayerEnding extends cc.Component { ...@@ -21,13 +21,13 @@ export default class LayerEnding extends cc.Component {
this.next_btn = pg.view.find(this.layer_center, "next_btn") this.next_btn = pg.view.find(this.layer_center, "next_btn")
pg.view.touchOn(this.replay_btn, this.onTouchReplay, this) pg.view.touchOn(this.replay_btn, this.onTouchReplay, this)
pg.view.touchOn(this.next_btn, this.onTouchNext, this) pg.view.touchOn(this.next_btn, this.onTouchNext, this)
pg.event.on('layer_ending_show', () => { pg.event.on('layer_ending_show', (data) => {
this.showLayer(); this.showLayer(data);
}) })
} }
showLayer() { showLayer(data) {
pg.view.visible(this.layer_center, true) pg.view.visible(this.layer_center, true)
pg.view.setString(pg.view.find(this, 'coin_num'), 'X3'); pg.view.setString(pg.view.find(this.layer_center, 'finish_box/coin_num'), 'X' + data.coin);
let finish_cat = pg.view.find(this.layer_center, "finish_cat") let finish_cat = pg.view.find(this.layer_center, "finish_cat")
pg.view.playDBAnimation(finish_cat, "finish", 1); pg.view.playDBAnimation(finish_cat, "finish", 1);
......
This diff is collapsed.
...@@ -43,6 +43,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -43,6 +43,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
content: question.text content: question.text
} }
}) })
this.sentence_list.sort((A, B) => Math.random() - 0.5)
.sort((A, B) => Math.random() - 0.5)
.sort((A, B) => Math.random() - 0.5)
.sort((A, B) => Math.random() - 0.5);
} }
private layer_bg: cc.Node; private layer_bg: cc.Node;
...@@ -79,6 +83,10 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -79,6 +83,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
initGame() { initGame() {
this.current = -1; this.current = -1;
this.sentence_list.sort((A, B) => Math.random() - 0.5)
.sort((A, B) => Math.random() - 0.5)
.sort((A, B) => Math.random() - 0.5)
.sort((A, B) => Math.random() - 0.5);
this.initSentence(); this.initSentence();
} }
get currentQuestion() { get currentQuestion() {
...@@ -312,7 +320,9 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -312,7 +320,9 @@ export default class SceneComponent extends MyCocosSceneComponent {
gameOver() { gameOver() {
pg.view.visible(this.sentence_box, false) pg.view.visible(this.sentence_box, false)
pg.event.emit('layer_ending_show') pg.event.emit('layer_ending_show', {
coin: this.sentence_list.length * 3
})
} }
} }
......
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