Repository navigation
3 jogadores: tabuleiro em triângulo 🔺 - #6
Merged
Merged
Conversation
With 3 players the board is now a big triangle cut into small triangles, one side facing each player, who starts in the middle of it. - Board: generic topology (square grid or triangle); the grid is unchanged. Board.triangle(n) builds n² small triangles with each player's home mid-side and a 5-triangle starting strip. - Renderer: triangles merge into blobs like the squares (shared sides joined, free corners rounded, candy depth on the sides facing down) on a triangular plate; avatars and messages stand perpendicular to their side. The board is fitted to its real box, avatars included. - Upright tablet: the triangle points right ▶ (player 3 on the left). Lying sideways: player 2 moves to the right and the triangle points up ▲, so it uses the whole screen. Going round the board the order of the players is the same, so turning the tablet mid-game still works. - Tests for the triangle board and the seating; README and help updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G6VuNHCmVuv78s6tvPmWbJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Com 3 jogadores, o tabuleiro passa a ser um triângulo grande feito de triângulos pequenos. Cada lado fica virado para um jogador, que começa a meio desse lado. Com 2 ou 4 jogadores o tabuleiro continua quadriculado, sem alterações.
Como fica
Implementação
src/board.ts: a topologia passou a ser genérica (grelha ou triângulo) e a grelha não mudou.Board.triangle(n)cria n² triângulos, com a casa de cada jogador a meio do seu lado e uma faixa inicial de 5 triângulos. O "avançar" de cada jogador mede a distância a partir do seu lado.triCell/triEdgedão a geometria.src/renderer.ts: novo modo triângulo (drawTri, placa,homeAngle). O tabuleiro é encaixado na sua caixa real, com margem só onde há avatares.paintCellé partilhado entre os dois modos.src/ui/seats.ts:sideOf()põe o jogador 2 à direita quando há 3 jogadores e o tablet está deitado. É usado pelo jogo, pelo menu e pelos cartões de pausa e de resultados.Testes
npm test: 63 testes a passar. São novos os testes do tabuleiro triangular (vizinhos partilham um lado inteiro, contagem de vizinhos, casa a meio do lado, crescimento para o centro, KO e inundação) e de quem se senta onde.npm run buildOK.Generated by Claude Code