Commit 8a232f22 authored by 章红平's avatar 章红平

提交

parent 63aa9365
This diff is collapsed.
......@@ -3034,7 +3034,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 2000,
"width": 2500,
"height": 35
},
"_anchorPoint": {
......@@ -3216,8 +3216,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 2000,
"height": 2000
"width": 4000,
"height": 4000
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......
......@@ -70,7 +70,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
}
initCandle1() {
this.candle1.x = -850
this.candle1.x = -cc.winSize.width/2-200
let candleS = this.candle1.getComponent("candle")
let maskNode = this.candle1.getChildByName("mask");
candleS.dragon1.node.active = true;
......@@ -78,7 +78,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
candleS.dragon3.node.active = false;
}
initCandle2() {
this.candle2.x = -850
this.candle2.x = -cc.winSize.width/2-200
let maskNode = this.candle2.getChildByName("mask");
maskNode.height = this.candle2.height = 333
let candleS = this.candle2.getComponent("candle")
......@@ -89,19 +89,19 @@ export default class cake_class_1 extends MyCocosSceneComponent {
this.initCandle2();
this.playLocalAudio("in")
cc.tween(this.candle2)
.to(0.3, { x: -550 })
.to(0.3, { x: -cc.winSize.width/2+150 })
.start();
}
moveInCandle1() {
this.initCandle1();
this.playLocalAudio("in")
cc.tween(this.candle1)
.to(0.3, { x: -550 })
.to(0.3, { x: -cc.winSize.width/2+150 })
.start();
}
moveOutCandle1(cb = null) {
cc.tween(this.candle1)
.to(0.3, { x: -850 })
.to(0.3, { x: -cc.winSize.width/2-200 })
.call(() => {
if (cb) cb();
})
......@@ -109,15 +109,15 @@ export default class cake_class_1 extends MyCocosSceneComponent {
}
moveOutCandle2() {
cc.tween(this.candle2)
.to(0.3, { x: -850 })
.to(0.3, { x: -cc.winSize.width/2-200 })
.start();
}
initMusicBtn() {
this.musicBtn.node.x = 850;
this.musicBtn.node.x = cc.winSize.width/2+200;
this.musicBtn.interactable = true;
}
initRedBtn() {
this.redBtnN.x = 850;
this.redBtnN.x = cc.winSize.width/2+200;
}
startGame() {
this.answerList[this.questionIndex] = 0;
......@@ -137,7 +137,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
}, this.data.questions[this.questionIndex].choosewaitTime * 1000)
this.initMusicBtn();
cc.tween(this.musicBtn.node)
.to(0.3, { x: 550 })
.to(0.3, { x: cc.winSize.width/2-150 })
.start()
})
this.moveInCandle1();
......@@ -200,6 +200,11 @@ export default class cake_class_1 extends MyCocosSceneComponent {
this.initListener();
}
start(): void {
super.start()
this.initCandle1();
this.initCandle2();
this.initRedBtn();
this.initMusicBtn();
let bgNode=cc.find("bg/bg",this.node);
let scaleX=cc.winSize.width/bgNode.width;
let scaleY=cc.winSize.height /bgNode.height;
......@@ -208,8 +213,9 @@ export default class cake_class_1 extends MyCocosSceneComponent {
}else{
bgNode.scale=scaleY;
}
}
initNodePos(){
super.start();
}
dataCallBack() {
super.dataCallBack();
......@@ -259,7 +265,7 @@ export default class cake_class_1 extends MyCocosSceneComponent {
this.clearTimeouts()
if (isSuc) {
cc.tween(this.musicBtn.node)
.to(0.3, { x: 850 })
.to(0.3, { x: cc.winSize.width/2+200 })
.call(() => {
})
......
......@@ -51,7 +51,7 @@ export default class panel extends cc.Component {
// }, "waitTime": 12, "choosewaitTime": 5, "testWaitTime": 3, "rightLetter": "d", "wrongLetter": "b"
// }, }
initPanel(data, mainCtil) {
this.frameN.y = 1000;
this.frameN.y = cc.winSize.height+400;
this.frameN.off("click");
this.frameN.on("click", () => {
this.playDragon();
......@@ -87,8 +87,8 @@ export default class panel extends cc.Component {
rightPice.zIndex = 10 - index;
rightPice.parent = picesN;
wrongPice.parent = picesN;
rightPice.x = 450
wrongPice.x = 450
rightPice.x = cc.winSize.width/2-200
wrongPice.x =cc.winSize.width/2-200
wrongPice.name = "wrongPice"
rightPice.name = "rightPice"
rightPice.getComponentInChildren(cc.Label).string = data.rightLetter;
......@@ -172,13 +172,13 @@ export default class panel extends cc.Component {
}
)
cc.tween(this.mainCtil.musicBtn.node)
.to(0.3, { x: 900 })
.to(0.3, { x: cc.winSize.width/2+200 })
.start();
} else {
rightPice.active = false;
this.mainCtil.moveOutCandle1()
cc.tween(this.mainCtil.musicBtn.node)
.to(0.3, { x: 900 })
.to(0.3, { x: cc.winSize.width/2+200 })
.start();
this.mainCtil.playLocalAudio("err");
cc.tween(wrongPice)
......@@ -198,7 +198,7 @@ export default class panel extends cc.Component {
outPice() {
let wrongPice = cc.find("cake/picesP", this.node).getChildByName("wrongPice")
cc.tween(wrongPice)
.to(0.3, { x: 1100 })
.to(0.3, { x: cc.winSize.width/2+400 })
.call(() => {
wrongPice.destroy();
cc.tween(this.frameN)
......@@ -211,7 +211,7 @@ export default class panel extends cc.Component {
this.mainCtil.moveInCandle2();
this.mainCtil.initRedBtn();
cc.tween(this.mainCtil.redBtnN)
.to(0.3, { x: 550 })
.to(0.3, { x: cc.winSize.width/2-150 })
.start();
// guideAudio
})
......@@ -232,8 +232,9 @@ export default class panel extends cc.Component {
}
}
showBlock(){
let block = this.node.getChildByName("block");
let block = cc.find("cake/block",this.node);
block.active = true;
block.getChildByName("bg").getComponent(cc.Widget).target=cc.find("Canvas");
block.opacity = 0;
cc.tween(block)
.to(0.5, { opacity: 255 })
......@@ -245,10 +246,14 @@ export default class panel extends cc.Component {
}
showResult(isSuc) {
// this.dragon.node.active=false;
let block = this.node.getChildByName("block");
let block = cc.find("cake/block",this.node);
block.getChildByName("bg").getComponent(cc.Widget).target=cc.find("Canvas");
let nicetry = block.getChildByName("nicetry");
this.dragon1.node.active=true;
this.dragon1.node.active=false;
nicetry.active=false;
if (isSuc) {
this.dragon1.node.active=true;
this.mainCtil.playLocalAudio("excellent")
this.dragon1.playAnimation("newAnimation", 1)
this.dragon1.on(dragonBones.EventObject.COMPLETE, () => {
......@@ -259,6 +264,7 @@ export default class panel extends cc.Component {
})
} else {
nicetry.active=true;
this.mainCtil.playLocalAudio("talkerr")
this.dragon1.node.active = false;
cc.tween(nicetry)
......@@ -281,10 +287,12 @@ export default class panel extends cc.Component {
this.dragon.node.active = false;
let length=answerList.length;
let sucTime=0;
let over=cc.find("over",this.node);
let over=cc.find("cake/over",this.node);
over.active=true;
let nicetry=cc.find("over/nicetry",this.node);
let comeon=cc.find("over/comeon",this.node)
let nicetry=cc.find("cake/over/nicetry",this.node);
let comeon=cc.find("cake/over/comeon",this.node)
nicetry.active=false;
comeon.active=false;
for(let i=0;i<length;i++){
if(answerList[i]==1){
sucTime++
......@@ -298,6 +306,7 @@ export default class panel extends cc.Component {
this.dragon2.playAnimation("normal", 1)
this.mainCtil.playLocalAudio("allRigtht")
}else if((sucTime/length)>=0.6){
nicetry.active=true;
this.mainCtil.playLocalAudio("nicetry");
cc.tween(nicetry)
.to(0.3, { y: -50 })
......@@ -306,6 +315,7 @@ export default class panel extends cc.Component {
.to(0.3, { y: -700 })
.start();
}else{
comeon.active=true;
this.mainCtil.playLocalAudio("comeon")
cc.tween(comeon)
.to(0.3, { y: -50 })
......
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