|
|
|
@ -81,7 +81,6 @@ class Board{
|
|
|
|
ctx.fillText(name, 0, 10);
|
|
|
|
ctx.fillText(name, 0, 10);
|
|
|
|
|
|
|
|
|
|
|
|
this.drawCardsOnBoard();
|
|
|
|
this.drawCardsOnBoard();
|
|
|
|
this.drawCardsOnBoardOpponent();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.drawDecks();
|
|
|
|
this.drawDecks();
|
|
|
|
|
|
|
|
|
|
|
|
@ -587,27 +586,6 @@ class Board{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
drawCardsOnBoardOpponent(){
|
|
|
|
|
|
|
|
// OLD, being rewritten
|
|
|
|
|
|
|
|
if(true){
|
|
|
|
|
|
|
|
for (let i = 0; i < opponentBoard.length; i++) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let name = 'cardOnBoardOpponent_'+(i+1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let cardPadding = 10;
|
|
|
|
|
|
|
|
let fill = '#'+i+i+'AA00';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: fix positionX, actually have some maffs
|
|
|
|
|
|
|
|
let positionX = canvas.width/2 - (cardWidth * (opponentBoard.length - (i+1)) - (cardPadding * (i+1)));
|
|
|
|
|
|
|
|
let positionY = cardHeight + 30;
|
|
|
|
|
|
|
|
let width = cardWidth;
|
|
|
|
|
|
|
|
let height = cardHeight;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.drawCard(opponentBoard, i, name, positionX, positionY, width, height, fill);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Currently only functionality in hand
|
|
|
|
// Currently only functionality in hand
|
|
|
|
playCardToBoard(index){
|
|
|
|
playCardToBoard(index){
|
|
|
|
// Get the card data
|
|
|
|
// Get the card data
|
|
|
|
|