Skip to content

Visual overhaul: dark theme, 3D pieces, styled sidebar#2

Open
WalkmanOfWar wants to merge 4 commits into
masterfrom
feature/visual-improvements
Open

Visual overhaul: dark theme, 3D pieces, styled sidebar#2
WalkmanOfWar wants to merge 4 commits into
masterfrom
feature/visual-improvements

Conversation

@WalkmanOfWar

Copy link
Copy Markdown
Owner

Co zostało zmienione

Plansza

  • Nowe kolory pól: krem #F0D9B5 / brąz #8B4513 (klasyczna paleta drewniana)
  • Złota ramka wokół planszy + miękki cień (DropShadow)
  • Plansza odsunięta o 10 px od krawędzi okna dla lepszego oddechu

Sidebar

  • Ciemny panel nawigacyjny (#1c1c30) z zaokrąglonymi narożnikami
  • Złoty tytuł „WARCABY" z efektem poświaty
  • Karty graczy z kolorowymi obwódkami (czerwona / szara), miniaturą pionka i dużą cyfrą licznika
  • Karta timera z niebieskim akcentem
  • Komunikat o wygranej z żółtą poświatą

Pionki

  • Zastąpiono płaskie Ellipse grupą kształtów (Group) z:
    • gradientem radialnym (efekt 3D)
    • zewnętrzną obwódką i wewnętrznym pierścieniem
    • błyskiem spekulacyjnym (biała elipsa ~30% opacity)
    • cieniem pod pionkiem
  • Damki: ciemniejszy gradient + złota podwójna obwódka + symbol korony ♛

Interakcja

  • Hover na pionku → delikatna biała poświata
  • Przeciąganie → skalowanie 113% + unoszący się cień (DropShadow)
  • resetScale() wywoływane przy zwolnieniu myszy

Techniczne

  • Piece.java: ładuje wizual jako Node (zamiast Ellipse), obsługa wszystkich 4 typów
  • CheckersApp.java: offset grup o BOARD_OFFSET=10, stage.setResizable(false), tytuł → „Warcaby"
  • Rozmiar okna: 1060×840 (dostosowany do nowego layoutu)

Jak przetestować

mvn clean javafx:run

Sprawdź:

  • Pionki renderują się z gradientem i błyskiem
  • Damki mają koronę ♛ i złotą obwódkę
  • Sidebar wyświetla liczniki, timer i komunikat o wygranej
  • Hover / drag dają wizualny feedback

🤖 Generated with Claude Code

Maciej Sierzputowski and others added 4 commits May 12, 2026 20:37
- Fix critical bug: Controller was instantiated with `new Controller()` instead
  of being retrieved from FXMLLoader, so @FXML fields were never injected
- Replace fragile hardcoded child-index label access (root.getChildren().get(4..8))
  with proper @FXML-bound labels and direct property binding for the timer
- Collapse 80-line repetitive canStrikeMore() into canCaptureAgain() + a single
  canCaptureInDirection() helper that handles bounds and direction generically
- Extract isWrongTurn() and isOpponent() helpers to clarify tryMove() conditions
- Rename PieceType.isKing -> secondaryDir (the field held a direction value, not a bool)
- Rename MoveType.KILL -> CAPTURE; MoveResult.piece -> capturedPiece
- Remove unnecessary StackPane extension from StopWatch; add start()/stop() methods
  and expose time via textProperty() for direct JavaFX binding
- Add Piece.promoteToKing(); simplify changeToKing() which had a pointless loop
- Handle all four PieceType values in Piece constructor (was silently producing null)
- Add README.md with rules, controls, requirements and project structure

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Board.fxml: complete sidebar redesign — dark navy panel (#1c1c30),
  styled player cards with colored borders, gold title, timer card,
  glowing win-message label; window enlarged to 1060×840
- Tile.java: warm wood palette — cream #F0D9B5 / saddle brown #8B4513
- RedPiece / WhitePiece FXMLs: replaced flat Ellipse with Group containing
  radial-gradient body, outer rim, inner ring and specular highlight
- RedKingPiece / WhiteKingPiece FXMLs: darker richer gradient + gold ♛ crown
  and double gold ring to distinguish kings from regular pieces
- Piece.java: load visual as Node (supports Group root), hover glow via
  DropShadow, scale-up + lift shadow on mouse-press, resetScale() helper
- CheckersApp.java: board offset by 10 px, gold border Rectangle between
  tileGroup and pieceGroup, DropShadow on tileGroup, resetScale() called
  on mouse-released; stage title → "Warcaby", resizable = false

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- BOARD_OFFSET 10 → 40 px: pieces at column 0 were clipped because the
  Group's layout bounds start at x≈14 (not 0), so a 10 px offset placed
  the leftmost ellipse pixel right at the window edge
- Board.fxml: window 1080×900 (was 1060×840) — board (800×800) now sits
  at offset 40 with 40 px margin on all sides and 60 px at the bottom;
  sidebar shifted right to x=858 and all element positions updated
- boardBorder stroke thinned to 2 px and colour adjusted to match frame

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Piece StackPane was auto-sizing to the inner Group's layout bounds
(~72×55 px), not the tile size (100 px). Since the StackPane is
positioned at (x*100, y*100), the visual ended up in the top-left
corner of each square. Pinning min/pref/max size to TILE_SIZE makes
the StackPane fill the tile and CENTER alignment places the visual in
the middle. Also setPickOnBounds(false) so hover/click only trigger
on visible piece pixels, not the transparent padding.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant