Commit Graph

12 Commits

Author SHA1 Message Date
6882505174 Start a tap with drag
Now, only the empty squares contain a GestureDetector.
The GestureDetector is not necessary anymore in squares with pieces
because the tap is started when the drag is started.
2024-02-01 11:11:11 +01:00
212a54612c Implement moves by tapping the squares
This adds an option to dragging-and-dropping which is slightly hard on
smaller screens.

Fix promotions when tapping and fix handling of subsequently tapping two pieces of your color

Cancel tap if a drag is started (tapped square will not stay red in case a drag is started)

Change url strategy back to the hashtag thing

Change version

Fix bug that would not allow a piece move if you tried to take an opponents piece.

Fix the coloring of the last move after an invalid move was played.

Upgrading deps
2024-01-17 20:58:13 +01:00
8f4cd2266f Handle board status message
This is another step to allow reconnecting after connection loss or
browser closing.

When the game is left with the X button on the bottom right, we will
close the websocket connection, to let the server know, that we are
gone.

The server still has issues that prevent this from working flawlessly.

Remove unused import
2023-12-09 20:48:36 +01:00
130a2dae79 Make ChessSquare a stateful widget. 2023-09-04 21:52:40 +02:00
01dcc74cfc Refactor chess square and prepare display of square in check. 2023-09-04 21:39:51 +02:00
7c5439a635 Display last played move.
We now color the squares of the last move. This makes the state of the
board clearer and shows whose turn it is.
2023-08-19 03:45:03 +02:00
105b6e7565 Fix two bugs
1. Fix the bug that made black move first in a new game when the old
   game was ended during blacks turn.
2. Fix bug that offered the promotion dialog to the player when a pawn
   was moved on the last rank from any square

Also, a late initializer error was fixed because the wrong move variable
was used when a pawn reached the last rank.
2023-07-11 22:29:55 +02:00
a5befed62c Make promotions work. 2023-07-03 19:41:12 +02:00
3bec7a84d8 Lay foundation for promotions. 2023-07-01 09:29:43 +02:00
9492644ac9 Introduce changes in API (register game first, then ws connection). 2023-05-28 14:54:46 +02:00
8572aa73e6 Add ChessPosition that will handle position. 2023-01-30 22:39:13 +01:00
80a24bafd6 Add GoRouter and do a lot of renaming. 2022-12-25 16:16:23 +01:00