Move js files and start split/board redo
parent
579848c84c
commit
08df4d4552
@ -0,0 +1,19 @@
|
|||||||
|
function drawGameBoard(){
|
||||||
|
|
||||||
|
// Reset board
|
||||||
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||||
|
|
||||||
|
drawPlayerNames();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function drawPlayerNames(){
|
||||||
|
|
||||||
|
// Player Name
|
||||||
|
//ctx.fillText(playerName, 50, canvas.height - 50);
|
||||||
|
|
||||||
|
// Opponent Name
|
||||||
|
//ctx.fillText(opponentName, canvas.width - (ctx.measureText(opponentName).width + 50), 50);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
const canvasLeft = canvas.offsetLeft + canvas.clientLeft;
|
||||||
|
const canvasTop = canvas.offsetTop + canvas.clientTop;
|
||||||
|
|
||||||
|
ctx.font = "12px Arial";
|
||||||
|
canvas.style.backgroundColor = 'rgb(143 153 150)';
|
||||||
|
cardArt.src = '/images/cardArt.jpg';
|
||||||
|
cardBackArt.src = '/images/cardBack.jpg';
|
||||||
|
ctx.fillStyle = '#000';
|
||||||
|
|
||||||
@ -0,0 +1,22 @@
|
|||||||
|
const cardWidth = 80;
|
||||||
|
const cardHeight = 120;
|
||||||
|
|
||||||
|
const cardArt = new Image();
|
||||||
|
const cardBackArt = new Image();
|
||||||
|
|
||||||
|
const COLOUR = {
|
||||||
|
'white':{'id': 1, 'name':'White','colour':'#EEE'},
|
||||||
|
'blue':{'id':2, 'name':'Blue','colour':'#0033EE'},
|
||||||
|
'red':{'id':3, 'name':'Red','colour':'#ED344A'},
|
||||||
|
};
|
||||||
|
|
||||||
|
// To disable drawing each time something changes
|
||||||
|
let drawEachEvent = true; // For disabling draw each time and only occuring where I want to test
|
||||||
|
|
||||||
|
let yourPlayerId = 0; // To compare click events of your/opponents cards
|
||||||
|
let viewingPlayerId = 0; // To show the board from your/opponent/teammates perspective, etc. without play permission
|
||||||
|
|
||||||
|
const maxHandSize = 4;
|
||||||
|
const maxBoardSize = 3;
|
||||||
|
const maxShield = 2;
|
||||||
|
|
||||||
Loading…
Reference in New Issue