Fix : #7 Piece rotation now working

v1.01
Vincent ASTOLFI 6 months ago
parent 455f93f636
commit b1cd419e9d

@ -0,0 +1,6 @@
ACTUAL_ENV=dev
DB_USER=root
DB_PASSWORD=password
DB_NAME=battleship
DB_HOST=localhost
COOKIE_SECRET_KEY=secret_key

4
.gitignore vendored

@ -3,3 +3,7 @@ node_modules/
nginx.conf
nginx/
secrets/
.env
.env.*
!.env.example

@ -213,6 +213,18 @@ function validMoove(player, piece, movement) {
isValid = false;
if (!p.vertical && movement.selectedCase.y + p.size > 10)
isValid = false;
let head = p.startPos
let tail = { x: (p.startPos.x + p.size), y: p.startPos.y}
for (let x = head.x; x <= tail.x; x++) {
if (
player.grid.cases[x][tail.y].isShip &&
player.grid.cases[x][tail.y].piece.id !== p.id
) {
isValid = false
}
}
}
}
});

Loading…
Cancel
Save