Commit Graph

95 Commits

Author SHA1 Message Date
9bbde2927b Simplify flow and allow site reloads 2024-05-19 21:44:33 +02:00
c802251c9d fix url 2024-05-19 14:46:18 +02:00
544e0b22c5 Make games rejoinable
1. Disconnect websocket connection before connecting
2. store playerInfo when hosting a game to reuse it when rejoining
2024-05-15 19:44:02 +02:00
32caf86f7f Fix colors and make passphrase submittable via Enter
With this change, the lobby selector gets its dark background back.
Also, now the passphrase can be submitted by pressing Enter and not only
by clicking the 'check' icon.
2024-05-11 19:58:29 +02:00
67a4be17cd bump version 2024-05-09 22:48:15 +02:00
ebab1a4c46 upgrade dependencies 2024-03-11 02:05:32 +01:00
320dd247ff Bump version 2024-02-05 10:51:56 +01:00
9f64959498 Revert erroneous refactor 2024-02-05 10:39:01 +01:00
ba478fedca Fix snackbar in host/join dialog 2024-02-05 10:35:28 +01:00
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
13bcfb1131 Introduce checkmate screen
Show checkmate screen, once the server sends the 'gameEnded' message.

Additionally, show an icon that lets users copy the passphrase to the
clipboard.
2024-01-18 16:59:33 +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
cb8e98ef81 Fix building of web and linux app at the same time 2023-12-27 15:57:01 +01:00
cdc0144e39 Fix routing again 2023-12-27 15:46:15 +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
17ac437f5b Pop promotion dialog with context.pop() 2023-12-25 02:07:03 +01:00
7a51e71767 Make passphrase entry a dialog instead of a page.
Additionally, we set some groundwork for storing the game data (lobby
id, player id, passphrase) in permanent storage in order to reconnect
with it later.
2023-12-23 16:44:23 +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
80fe378241 Remove unused function. 2023-08-15 00:47:08 +02:00
43d8d77abc Fix the current position in ChessPositionManager, now that we rely on position instead of detecting en passant ourselves. 2023-08-15 00:39:10 +02:00
c213d9b1f3 Use position to build board
Now the client considers the position sent by the server to build the
position on the board.
2023-08-14 17:04:25 +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
da986c8d9b Make passphrase selectable. 2023-07-06 15:01:27 +02:00
4b8624f82b Fix bug that did not change the move color when a promotion was received. 2023-07-06 00:12:03 +02:00
95fba78d0c Change behavior of promotion dialog. 2023-07-06 00:06:03 +02:00
fea24c8274 Make castling work. 2023-07-05 21:16:01 +02:00
c3d747a60e Fix position. 2023-07-03 20:05:14 +02:00
9ce188ae32 dart fix 2023-07-03 19:55:44 +02:00
a5befed62c Make promotions work. 2023-07-03 19:41:12 +02:00
0f27fc6b4e Remove unused import. 2023-07-01 09:31:48 +02:00
3bec7a84d8 Lay foundation for promotions. 2023-07-01 09:29:43 +02:00
52540ec96c A lot of changes again?!? 2023-06-30 01:49:18 +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
e27f1c7c22 Change the point in time when the board gets cleared. 2023-06-09 13:19:03 +02:00
d55c7bbe1a Fix resetting the board in case a new game is started. 2023-06-08 20:23:00 +02:00
0627a627d8 Send new websocket message type for sending a move. 2023-06-08 17:14:50 +02:00
6e5d84364d Various changes. 2023-06-08 17:10:48 +02:00
605743c0d2 Introduce api types and some changes. 2023-06-02 23:28:40 +02:00
b0d6f4002c Change connection handling (Use playerID from registering to connect via websocket. 2023-05-28 17:44:22 +02:00
299b77d249 Resolve problems in files. 2023-05-28 14:56:01 +02:00