[]关于这个timer我的跑的快在 自己出完牌之后没有人比我的牌大了。可是我的牌还是出不去

computer()
{
Laya.timer.clear(this,this.computer);
var NTS: number;
var NTE: number;
this.nextTurn;
let i = this.turnNumber;
if(i==0){
return;

this.getPlayer();

gotoNext(){
this.turnNumber++;
if(this.turnNumber>3)
{
this.turnNumber=0
}

public getPlayer()//电脑出牌方法
{
var NTS: number;
var NTE: number;
this.turnNumber;
if (this.lastPaixing != "")
{
if ( this.turnNumber == 1)
{
NTS = 8;
NTE = 5;
}
if ( this.turnNumber == 2)
{
NTS = 12;
NTE = 9;
}
if (this.turnNumber== 3)
{
NTS = 16;
NTE = 13;
}
this.SortToOut(this.turnNumber);
console.log(this.nextTurn);
if (this.isAbleToOut)
{
this.computerOutPoker(this.turnNumber);
switch(this.turnNumber)
{
case 1:
this.setLableText("小明出牌了")
break;
case 2:
this.setLableText("小红出牌了")
break;
case 3:
this.setLableText("静静出牌了")
break;
}
//笔记
for (var j = 0; j < this.aaa.playerNameList[this.turnNumber].playerhandpoker.length; j++)
{
for (var k = 0; k < this.outHandPoker.length; k++)
{
if (this.outHandPoker[k] == this.aaa.playerNameList[this.turnNumber].playerhandpoker[j])
{
this.aaa.playerNameList[this.turnNumber].playerhandpoker.splice(j, 1);
}
}
}
this.gotoNext();
if (this.turnNumber > 3)
{
this.turnNumber = 0;
}//因为只有4个人 0 1 2 3 循环
this.nextTurn = NTE;
} else
{
if(this.nextTurn!=0)
{
switch(this.turnNumber)
{
case 1:
this.setLableText("小明要不起")
break;
case 2:
this.setLableText("小红要不起")
break;
case 3:
this.setLableText("静静要不起")
break;
}
this.gotoNext();
this.nextTurn++;
if (this.turnNumber > 3)
{
this.turnNumber = 0;
}//因为只有4个人 0 1 2 3 循环
 
}
 
Laya.timer.once(1000, this, this.computer,[this.turnNumber]);
//要不起的处理方式
}
 
}
console.log(this.nextTurn); 
if ( this.turnNumber == 1) { 
NTS = 8;
NTE = 5;
this.platerfirst(NTS,NTE);
}
if ( this.turnNumber == 2)
{
NTS = 12;
NTE = 9;
this.platerfirst(NTS,NTE);
}
if (this.turnNumber== 3) {
NTS = 16;
NTE = 13;
this.platerfirst(NTS,NTE);
}
if (this.nextTurn==4){
return;
}
if (this.turnNumber != 0) {
Laya.timer.once(1000, this, this.computer);
}//电脑出完电脑出

public platerfirst(NTS,NTE){
if (this.nextTurn == NTS || this.nextTurn == 0) {
this.goneLastSendPoker();//清空出牌界面
this.outHandPoker = [];
this.palayerfirst(this.turnNumber);
switch(this.turnNumber)
{
case 1:
this.setLableText("小明出牌了")
break;
case 2:
this.setLableText("小红出牌了")
break;
case 3:
this.setLableText("静静出牌了")
break;
}
this.gotoNext();
if (this.turnNumber > 3)
{
this.turnNumber = 0;
}//因为只有4个人 0 1 2 3 循环 
this.nextTurn = NTE;
}
}
public palayerfirst(i):void//当玩家第一个出牌 或者 玩家出的牌其他人都要不起
{
var j = this.aaa.playerNameList[i].playerhandpoker.length - 1;
var img: Laya.Image = this.aaa.playerNameList[i].playerhandpoker[j].img;
img.skin = this.aaa.playerNameList[i].playerhandpoker[j].PokerDre;
img.width = 76; img.height = 110;
img.pos(200 + i * 35, 230);
Laya.stage.addChild(img);
this.reciveOutPoker.push(img);
this.outHandPoker.push(this.aaa.playerNameList[i].playerhandpoker[j]);
this.lastPaixing = 1; 
for (let x = 0; x < this.outHandPoker.length; x++)
{
for (let j = 0; j < this.aaa.playerNameList[i].playerhandpoker.length; j++)
{
if (this.outHandPoker[x] == this.aaa.playerNameList[i].playerhandpoker[j])
{
this.aaa.playerNameList[i].playerhandpoker.splice(j, 1);
}
}


public SortToOut(P: number)//从电脑的牌组中分析是否有可以出的牌;
已邀请:

谭皓月

赞同来自:

像这样  我出的牌最大以后  就出不了牌了  但是点击要不起按钮会可以继续出牌
public bt_abodon() {
if(this.turnNumber!=0&&this.nextTurn!=4)
{
return;
}
this.gotoNext();
this.nextTurn++;
this.computer();

要回复问题请先

商务合作
商务合作