Commit Graph

24 Commits

Author SHA1 Message Date
93a84d442e bump version 2024-02-01 11:43:49 +01:00
200393ac76 Fix tapping on opponent's piece
With the previous change of starting a tap on a drag,
we removed the GestureDetector from all squares with any pieces.

This included the opponent's pieces. Tapping and taking an opponent's
piece was not possible anymore.

This was a bug, since we still want to detect a tap and take an opponent's piece.
2024-02-01 11:37:00 +01:00
e22dc213ac Bump version 2024-02-01 11:22:25 +01:00
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
289ec6db26 Fix turnColor handling 2023-12-25 18:08:21 +01:00
ba947ae5e4 Fix routing and move handling 2023-12-25 17:50:58 +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
f45ec47285 Fix green flicker of squares on invalid move 2023-08-25 12:28:58 +02:00
b9d574f2ab Fix 1-pixel lines between squares
In window widths or heigths that are not divisible by 8, the chess board
would contain lines between the squares (since the contraints of the
chess board rows would contain non-integer constraints).

With this commit, we calculate margins manually, in order to constrict
the chess board to widths and heights that are divisible by 8.
2023-08-22 04:24:30 +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
f2a4893b6f Do not convert short piece name to lower case. 2023-08-12 11:43:51 +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
43fca47dae Changes you see? To many to name them. And a splash screen for flutter web of course. 2023-06-28 12:37:59 +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
330aeed476 Make ChessAppRouter a class. 2022-12-25 20:30:42 +01:00
d1ba004ebb Restructure app. Change design. 2022-12-25 20:18:50 +01:00
4626084abd Do some more restructuring. ChessApp is now the app. ChessGame is the widget that contains the game and board. 2022-12-25 19:57:47 +01:00
80a24bafd6 Add GoRouter and do a lot of renaming. 2022-12-25 16:16:23 +01:00