Skip to content

Commit

Permalink
feat: online multiplayer (#119)
Browse files Browse the repository at this point in the history
feat: multiplayer
---------

Signed-off-by: Thomas Mauran <thomasmauran@yahoo.com>
  • Loading branch information
thomas-mauran authored Dec 15, 2024
1 parent 5a7adcf commit 95baabf
Show file tree
Hide file tree
Showing 42 changed files with 1,559 additions and 383 deletions.
87 changes: 47 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository = "https://github.com/thomas-mauran/chess-tui"
clap = { version = "4.4.11", features = ["derive"] }
dirs = "5.0.1"
ratatui = "0.28.1"
uci = "0.2.0"
uci = "0.2.1"
toml = "0.5.8"

[features]
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">
<h1>chess-tui</h1>
A chess TUI implementation in rust 🦀
A rusty chess game in your terminal 🦀

![board](./examples/play_against_white_bot.gif)

Expand All @@ -10,6 +10,10 @@ A chess TUI implementation in rust 🦀
</div>
</div>

### Description

Chess-tui is a simple chess game you can play from your terminal. It supports local 2 players mode, online multiplayer and playing against any UCI compatible chess engine.

### Quick install

```bash
Expand All @@ -30,7 +34,11 @@ If you want to install the game with your favorite package manager, you can find
</details>
<details>
<summary>Local 2 player mode</summary>
<img src="./examples/demo.gif" alt="Helper menu" />
<img src="./examples/demo.gif" alt="Local 2 players" />
</details>
<details>
<summary>Online multiplayer</summary>
<img src="./website/static/gif/multiplayer.gif" alt="Online multiplayer" />
</details>
<details>
<summary>Draws</summary>
Expand Down
Binary file modified examples/demo-two-player.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
73 changes: 37 additions & 36 deletions examples/demo-two-player.tape
Original file line number Diff line number Diff line change
Expand Up @@ -15,61 +15,62 @@ Set WindowBarSize 40
Type "cargo run" Sleep 500ms Enter

Sleep 0.5s
Down @0.8s
Down @0.8s
Down @0.8s
Down @0.8s
Down @0.8s
Space @0.8s
Down @0.3s
Down @0.3s
Down @0.3s
Down @0.3s
Down @0.3s
Down @0.3s
Space @0.3s
Sleep 1.5s

Down @0.8s
Down @0.8s
Space @0.8s
Down @0.3s
Down @0.3s
Space @0.3s
Sleep 0.8s
Space @0.8s
Space @0.3s

Sleep 0.8s
Left @0.8s
Space @0.8s
Left @0.3s
Space @0.3s
Sleep 0.8s
Space @0.8s
Space @0.3s

Down @0.8s
Space @0.8s
Down @0.3s
Space @0.3s
Sleep 0.8s
Space @0.8s
Space @0.3s
Sleep 0.8s

Right @0.8s
Right @0.8s
Right @0.8s
Space @0.8s
Right @0.3s
Right @0.3s
Right @0.3s
Space @0.3s
Sleep 0.8s
Space @0.8s
Space @0.3s
Sleep 0.8s

Left @0.8s
Space @0.8s
Left @0.3s
Space @0.3s
Sleep 0.8s
Right @0.8s
Right @0.8s
Space @0.8s
Right @0.3s
Right @0.3s
Space @0.3s
Sleep 0.8s

Up @0.8s
Right @0.8s
Right @0.8s
Space @0.8s
Up @0.3s
Right @0.3s
Right @0.3s
Space @0.3s
Sleep 0.8s
Space @0.8s
Space @0.3s
Sleep 0.8s


Up @0.8s
Up @0.8s
Up @0.8s
Space @0.8s
Up @0.3s
Up @0.3s
Up @0.3s
Space @0.3s
Sleep 0.8s
Space @0.8s
Space @0.3s
Sleep 0.8s
Binary file modified examples/helper.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/helper.tape
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Sleep 2s
Down @0.3s
Down @0.3s
Down @0.3s
Down @0.3s
Space @0.3s
Sleep 1s

Expand Down
Binary file modified examples/play_against_black_bot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 95baabf

Please sign in to comment.