Commit 0f929c59 authored by Tt's avatar Tt

1

parent 05e7caf6
This diff is collapsed.
{
"ver": "1.2.9",
"uuid": "8944c192-3675-466f-9f94-8f824c68e822",
"optimizationPolicy": "AUTO",
"asyncLoadAssets": false,
"readonly": false,
"subMetas": {}
}
\ No newline at end of file
// pg.event.on('layer_ending_touch_replay', () => {
// alert('replay')
// })
// pg.event.on('layer_ending_touch_next', () => {
// alert('next')
// })
// pg.event.emit('layer_ending_show')
import pg from "../../scene/pg_hy17_hds";
const { ccclass, property } = cc._decorator;
@ccclass
export default class LayerEnding extends cc.Component {
private layer_center: cc.Node;
private replay_btn: cc.Node;
private next_btn: cc.Node;
onLoad() {
this.layer_center = pg.view.find(this.node, "layer_center")
pg.view.visible(this.layer_center, false);
this.replay_btn = pg.view.find(this.layer_center, "replay_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.next_btn, this.onTouchNext, this)
pg.event.on('layer_ending_show', () => {
this.showLayer();
})
}
showLayer() {
pg.view.visible(this.layer_center, true)
pg.view.setString(pg.view.find(this, 'coin_num'), 'X3');
let finish_cat = pg.view.find(this.layer_center, "finish_cat")
pg.view.playDBAnimation(finish_cat, "finish", 1);
pg.view.visible(this.layer_center, true)
}
onTouchReplay() {
pg.view.visible(this.layer_center, false)
pg.event.emit('layer_ending_touch_replay');
}
onTouchNext() {
pg.view.visible(this.layer_center, false)
pg.event.emit('layer_ending_touch_next');
}
}
{
"ver": "1.0.8",
"uuid": "8aa90d3e-7980-43ef-be5d-3707ef42a804",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
This diff is collapsed.
...@@ -47,7 +47,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -47,7 +47,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
private layer_bg: cc.Node; private layer_bg: cc.Node;
private layer_game: cc.Node; private layer_game: cc.Node;
private layer_finish: cc.Node;
private res: cc.Node; private res: cc.Node;
private sentence_box: cc.Node; private sentence_box: cc.Node;
...@@ -60,7 +59,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -60,7 +59,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
initView() { initView() {
this.layer_bg = pg.view.find(this, "layer_bg") this.layer_bg = pg.view.find(this, "layer_bg")
this.layer_game = pg.view.find(this, "layer_game") this.layer_game = pg.view.find(this, "layer_game")
this.layer_finish = pg.view.find(this, "layer_finish")
this.res = pg.view.find(this, "res") this.res = pg.view.find(this, "res")
this.sentence_box = pg.view.find(this.layer_game, "sentence_box") this.sentence_box = pg.view.find(this.layer_game, "sentence_box")
...@@ -68,14 +66,16 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -68,14 +66,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
this.time_area = pg.view.find(this.microphone_area, "time_area") this.time_area = pg.view.find(this.microphone_area, "time_area")
this.time = pg.view.find(this.time_area, "time") this.time = pg.view.find(this.time_area, "time")
this.coin_area = pg.view.find(this.layer_game, "coin_area") this.coin_area = pg.view.find(this.layer_game, "coin_area")
this.replay_btn = pg.view.find(this.layer_finish, "replay_btn")
this.next_btn = pg.view.find(this.layer_finish,"next_btn")
} }
initListener() { initListener() {
pg.view.touchOn(this.microphone_area, this.onTouchRecordEnd, this); pg.view.touchOn(this.microphone_area, this.onTouchRecordEnd, this);
pg.view.touchOn(this.replay_btn,this.onTouchReplay,this) pg.event.on('layer_ending_touch_replay', () => {
pg.view.touchOn(this.next_btn,this.onTouchNext,this) this.onTouchReplay();
})
pg.event.on('layer_ending_touch_next', () => {
this.onTouchNext();
})
} }
initGame() { initGame() {
this.current = -1; this.current = -1;
...@@ -85,8 +85,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -85,8 +85,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
return this.sentence_list[this.current]; return this.sentence_list[this.current];
} }
initSentence() { initSentence() {
if(!this.sentence_box) return if (!this.sentence_box) return
pg.view.visible(this.sentence_box,true) pg.view.visible(this.sentence_box, true)
this.current++; this.current++;
if (!this.currentQuestion) { if (!this.currentQuestion) {
this.gameOver(); this.gameOver();
...@@ -123,13 +123,11 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -123,13 +123,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
// this.coinShow() // this.coinShow()
} }
onTouchReplay(){ onTouchReplay() {
pg.view.visible(this.layer_finish,false)
this.initGame() this.initGame()
} }
onTouchNext(){ onTouchNext() {
pg.view.visible(this.layer_finish,false)
this.initGame() this.initGame()
} }
...@@ -141,8 +139,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -141,8 +139,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
private recording: boolean; private recording: boolean;
private microPhoneChange: boolean; private microPhoneChange: boolean;
private replay_btn:cc.Node;
private next_btn:cc.Node;
showTimeStart() { showTimeStart() {
if (!this.targetTime) return; if (!this.targetTime) return;
let nowTime = new Date().getTime(); let nowTime = new Date().getTime();
...@@ -315,10 +311,8 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -315,10 +311,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
} }
gameOver() { gameOver() {
pg.view.visible(this.sentence_box,false) pg.view.visible(this.sentence_box, false)
let finish_cat = pg.view.find(this.layer_finish,"finish_cat") pg.event.emit('layer_ending_show')
pg.view.playDBAnimation(finish_cat, "finish", 1);
pg.view.visible(this.layer_finish,true)
} }
} }
......
{
"ver": "2.3.5",
"uuid": "5280a8a9-de36-4f7e-aca7-6cac4ad3cfd5",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1920,
"height": 1080,
"platformSettings": {},
"subMetas": {
"finish_view_hy17_hds": {
"ver": "1.0.4",
"uuid": "0e1692bb-fa87-43c7-9f4f-94abae3974f6",
"rawTextureUuid": "5280a8a9-de36-4f7e-aca7-6cac4ad3cfd5",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1920,
"height": 1080,
"rawWidth": 1920,
"rawHeight": 1080,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ 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