Visual overhaul: dark theme, 3D pieces, styled sidebar#2
Open
WalkmanOfWar wants to merge 4 commits into
Open
Conversation
- 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>
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.
Co zostało zmienione
Plansza
#F0D9B5/ brąz#8B4513(klasyczna paleta drewniana)DropShadow)Sidebar
#1c1c30) z zaokrąglonymi narożnikamiPionki
Ellipsegrupą kształtów (Group) z:Interakcja
DropShadow)resetScale()wywoływane przy zwolnieniu myszyTechniczne
Piece.java: ładuje wizual jakoNode(zamiastEllipse), obsługa wszystkich 4 typówCheckersApp.java: offset grup oBOARD_OFFSET=10,stage.setResizable(false), tytuł → „Warcaby"1060×840(dostosowany do nowego layoutu)Jak przetestować
Sprawdź:
🤖 Generated with Claude Code