feat: draw one card after each turn with slide-in animation

This commit is contained in:
kevin.lhereec committed 2026-08-17 12:07:47 +02:00
1 parent ec5a7ec2c3
commit b46cb707cd
3 files changed
+102 -10

No files matched your search

+9 -3
View File
@@ -165,13 +165,19 @@ function shuffle(arr) {
return a
}
/**
* Pour chaque joueur : retourne { hand, deck } (hand = les N premières cartes, deck = le reste)
*/
function dealHands(playerCount, handSize = 4) {
const hands = []
const result = []
for (let i = 0; i < playerCount; i++) {
const deck = shuffle(getDeckForTeam(i))
hands.push(deck.slice(0, handSize))
result.push({
hand: deck.slice(0, handSize),
deck: deck.slice(handSize) // cartes restantes à piocher
})
}
return hands
return result
}
module.exports = { CHARACTERS, TEAM_COLORS, ATTR_COLORS, getDeckForTeam, dealHands }