Commit 68659313 authored by yu's avatar yu

1

parent c834e72c
...@@ -15663,8 +15663,8 @@ ...@@ -15663,8 +15663,8 @@
"__type__": "TypedArray", "__type__": "TypedArray",
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
216.927, 215,
-146.147, -145,
0, 0,
0, 0,
0, 0,
......
...@@ -97,8 +97,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -97,8 +97,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.randomPopo(); this.randomPopo();
this.starAction(); this.starAction();
this.flyAction(); this.flyAction();
let hammer = cc.find("hammer", this.layout_game); this.initHammer();
hammer.active = true;
} }
private initListener() { private initListener() {
...@@ -118,8 +117,15 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -118,8 +117,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
}) })
pg.event.on('layer_coin_show_coin_end', () => { pg.event.on('layer_coin_show_coin_end', () => {
this.nextEgg(); this.nextEgg();
this.initHammer();
}) })
} }
private initHammer() {
let hammer = cc.find("hammer", this.layout_game);
hammer.active = true;
hammer.angle = 0;
hammer.setPosition(215, -145);
}
replay() { replay() {
this.initData(); this.initData();
this.initView(); this.initView();
...@@ -169,14 +175,12 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -169,14 +175,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
private gameOver() { private gameOver() {
Game.getIns().state = GAME_STATE.OVER; // pg.event.emit('layer_ending_show', { coin: this.score })
let data: any = {}; const midd = cc.find('middleLayer');
data.total = Game.getIns().total; if (!midd) return this.log("no middleLayer");
data.right = Game.getIns().player.right; let middleLayer = midd.getComponent('middleLayer');
data.scores = Game.getIns().player.voices; middleLayer.saveGolds(Game.getIns().len * 3); // 保存金币数量;num 是获得金币的数量,数字类型;
data.stone = Math.floor(10 * data.right / data.total); middleLayer.goNextPage(); // 跳转到下一页
this.log("total: " + data.total + " right: " + data.right + " stone: " + data.stone);
onHomeworkFinish(data)
} }
gameStart() { gameStart() {
...@@ -315,7 +319,7 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -315,7 +319,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.touchData.parent.active = false; this.touchData.parent.active = false;
this.tempCount = 0; this.tempCount = 0;
if (this.checkIsOver()) { if (this.checkIsOver()) {
pg.event.emit('layer_ending_show', { coin: this.score }) this.gameOver();
} }
} }
} }
......
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