Commit df7b2366 authored by 杨一航's avatar 杨一航

fix

parent a9681f62
......@@ -10,6 +10,9 @@ const { ccclass, property } = cc._decorator;
@ccclass
export default class EndView extends cc.Component {
@property(cc.Node)
frame: cc.Node = null;
@property(cc.Node)
winRoot: cc.Node = null;
......@@ -32,13 +35,18 @@ export default class EndView extends cc.Component {
replayNode: cc.Node = null;
onLoad() {
this.node.opacity = 0;
this.replayNode.on("click", this.replay, this)
}
showView(win: boolean, redScore, blueScore, redUrl, blueUrl) {
this.node.opacity = 255;
this.frame.scale = 0;
cc.tween(this.frame).to(1, { scale: 1 }, { easing: "sineIn" }).start();
this.winRoot.active = win;
this.loseRoot.active = !win;
this.lb_blue.string = blueScore;
......@@ -53,7 +61,7 @@ export default class EndView extends cc.Component {
}
replay() {
cc.game.restart();
cc.director.loadScene("L5R1_bingo");
}
}
......@@ -43,14 +43,14 @@ export default class Keyboard extends cc.Component {
for (let i = 0; i < btnList.length; ++i) {
let btnNode = btnList[i];
let key = btnNode.name;
btnNode.on("click", this.enterWord.bind(this, key), this);
btnNode.getChildByName("btn").on("click", this.enterWord.bind(this, key), this);
}
this.btnOkNode.on("click", this.sendWords, this)
this.btnbackNode.on("click", this.backWord, this)
this.btnShowNode.on("click", this.showIn, this)
this.btnHideNode.on("click", this.showOut, this)
this.btnHideNode.on("click", this.showOut.bind(this, false), this)
this.btnShowNode.active = false;
this.btnHideNode.active = false;
......@@ -97,7 +97,6 @@ export default class Keyboard extends cc.Component {
}
showOut(hideMini = false) {
if (this._moving) return;
this._moving = true;
this._wordList = [];
......@@ -108,7 +107,9 @@ export default class Keyboard extends cc.Component {
if (hideMini) {
this.btnShowNode.active = false;
this.btnHideNode.active = false;
} else {
this.btnShowNode.active = true;
this.btnHideNode.active = false;
}
}
}
This diff is collapsed.
This diff is collapsed.
......@@ -64,9 +64,9 @@ export class AI {
} else if (type == MsgType.ROUND_END_EV) {
let data = msgData;
if (data.round == 1) {
this._countDelay = 500000000;
} else {
this._countDelay = 500000000;
}
}
}
......
......@@ -135,7 +135,12 @@ export class MyCocosSceneComponent extends cc.Component {
// ------------------------------------------------
getSprNode(resName) {
const sf = cc.find('Canvas/res/img/' + resName).getComponent(cc.Sprite).spriteFrame;
let nodef = cc.find('Canvas/res/img/' + resName)
if (!nodef) {
console.warn("no name res = " + resName);
return;
}
const sf = nodef.getComponent(cc.Sprite).spriteFrame;
const node = new cc.Node();
node.addComponent(cc.Sprite).spriteFrame = sf;
return node;
......
......@@ -42,7 +42,7 @@ export class GameServer {
_answerList = []
private _useAI: boolean;
private _timer: number;
private _totalTime: number = 16;
private _totalTime: number = 160;
private _gameData: MsgData;
private _userPrepareCount: number;
private _lastTime: number;
......@@ -238,10 +238,13 @@ export class GameServer {
data: this._gameData.Msg
})
let realRedScore = (Math.floor(this._gameData.RedScore / 100) + this._gameData.RedScore % 100);
let realBlueScore = (Math.floor(this._gameData.BuleSocre / 100) + this._gameData.BuleSocre % 100);
let winSide = "Red"
if (this._gameData.BuleSocre > this._gameData.RedScore) {
if (realBlueScore > realRedScore) {
winSide = "Blue"
} else if (this._gameData.BuleSocre == this._gameData.RedScore) {
} else if (realRedScore == realBlueScore) {
let answerList = this._gameData.getAnswerList();
for (let i = answerList.length - 1; i >= 0; ++i) {
let answer = answerList[i];
......@@ -385,17 +388,16 @@ export class GameServer {
});
if (this._gameData.getAnswerList().length == 16) {
this._senMsg({
type: MsgType.ROOM_ST,
data: this._gameData.Msg
});
let answerList = this._gameData.getAnswerList();
for (let i = 0; i < answerList.length; ++i) {
this._round_1_cardList.push(answerList[i].word);
}
this._senMsg({
type: MsgType.ROUND_END_EV,
data: { round: this._gameData.Round, reason: 1, answerList: this._round_1_cardList }
data: { round: this._gameData.Round, reason: 1, answerList: answerList }
});
clearInterval(this._timer)
this._initRound2();
} else {
......
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