mirror of
https://github.com/taigrr/JSCheckers
synced 2025-01-18 04:33:13 -08:00
Removed ability to capture backwards except for in coomplex moves
This commit is contained in:
parent
e7188d58bb
commit
7a86cc9ad0
@ -175,6 +175,9 @@ function movePiece(idName, XCoor, YCoor)
|
|||||||
}
|
}
|
||||||
else if(((multPossible&&(lastUsed==(fromCol+'a'+fromRow)))||((fromType).substring(0,1)!=lastPlayer.substring(0,1)))&&(Math.abs(toRow-fromRow)<3)&&(Math.abs(toCol-fromCol)<3)&&((avType=='red')||(avType=='redK')||(avType=='black')||(avType=='blackK')))
|
else if(((multPossible&&(lastUsed==(fromCol+'a'+fromRow)))||((fromType).substring(0,1)!=lastPlayer.substring(0,1)))&&(Math.abs(toRow-fromRow)<3)&&(Math.abs(toCol-fromCol)<3)&&((avType=='red')||(avType=='redK')||(avType=='black')||(avType=='blackK')))
|
||||||
{
|
{
|
||||||
|
if((!(((fromType=='red')&&(toRow<fromRow))||((fromType=='black')&&(toRow>fromRow))))||(multPossible&&(lastUsed==(fromCol+'a'+fromRow))))
|
||||||
|
{
|
||||||
|
|
||||||
if(fromType=='black'||fromType=='blackK')
|
if(fromType=='black'||fromType=='blackK')
|
||||||
{
|
{
|
||||||
if(avType=='red'||avType=='redK')
|
if(avType=='red'||avType=='redK')
|
||||||
@ -201,6 +204,8 @@ function movePiece(idName, XCoor, YCoor)
|
|||||||
lastPlayer = arrSquares[toRow][toCol].type;
|
lastPlayer = arrSquares[toRow][toCol].type;
|
||||||
multPossible=true;
|
multPossible=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
checkKing();
|
checkKing();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user