cody - HTMLify profile

cody
4270 Files
633000 Views
Latest files of /cody/69PercentFat/Js-Chess/pieces
class Pawn extends Piece {
constructor(position, name) {
super(position, 'pawn', name)
}
getAllowedMoves() {
const position = this.position;
const mathSign = (this.color === 'white') ? 1: -1;
constructor(position, name) {
super(position, 'pawn', name)
}
getAllowedMoves() {
const position = this.position;
const mathSign = (this.color === 'white') ? 1: -1;
class Queen extends Piece {
constructor(position, name) {
super(position, 'queen', name);
}
getAllowedMoves(){
return [
this.getMovesTop(),
constructor(position, name) {
super(position, 'queen', name);
}
getAllowedMoves(){
return [
this.getMovesTop(),
class Piece {
constructor(position, rank, name) {
this.position = position;
this.rank = rank;
this.name = name;
this.color = this.name.substring(0,5);
}
constructor(position, rank, name) {
this.position = position;
this.rank = rank;
this.name = name;
this.color = this.name.substring(0,5);
}
class Rook extends Piece {
constructor(position, name) {
super(position, 'rook', name);
this.ableToCastle = true;
}
changePosition(position) {
this.position = parseInt(position);
constructor(position, name) {
super(position, 'rook', name);
this.ableToCastle = true;
}
changePosition(position) {
this.position = parseInt(position);
class King extends Piece {
constructor(position, name) {
super(position, 'king', name);
this.ableToCastle = true;
}
getAllowedMoves() {
constructor(position, name) {
super(position, 'king', name);
this.ableToCastle = true;
}
getAllowedMoves() {
class Bishop extends Piece {
constructor(position, name) {
super(position, 'bishop', name);
}
getAllowedMoves() {
return [ this.getMovesTopRight(), this.getMovesTopLeft(), this.getMovesBottomRight(), this.getMovesBottomLeft() ];
}
constructor(position, name) {
super(position, 'bishop', name);
}
getAllowedMoves() {
return [ this.getMovesTopRight(), this.getMovesTopLeft(), this.getMovesBottomRight(), this.getMovesBottomLeft() ];
}