Skip to content

Commit 0fc088b

Browse files
Merge pull request #156 from Longwater1234/dev
Ready for making public on Github
2 parents 03d4b59 + 35a300a commit 0fc088b

File tree

11 files changed

+32
-20
lines changed

11 files changed

+32
-20
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ bld/
2020
.idea/
2121
/cmake-build-*/
2222

23-
2423
# Prerequisites
2524
*.d
2625

@@ -56,5 +55,4 @@ bld/
5655
*.app
5756
*.zip
5857
*.rar
59-
.DS_Store
60-
game_map.txt
58+
.DS_Store

BUILDING.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Building Locally
1+
# Building Locally (Release mode only)
22

33
## On Windows
44

@@ -31,7 +31,11 @@ cmake --build . --config Release --target all
3131
![cmake_screenshot](cmake/cmake_gui_screenshot.png)
3232

3333
- Set "Source Folder" (1) to this project root dir. Then, set "Build Folder" (2) to a NEW _relative_ folder `/build` or `/out`.
34-
- Ensure "CMAKE_BUILD_TYPE" is **Release** (see image above, blue highlight). Ignore other settings. Then (3) click "**Configure**".
34+
- Ensure "CMAKE_BUILD_TYPE" is **Release** (see image above, blue highlight). Ignore other settings. Then (3) click **Configure**.
3535
- In the popup window, choose generator **'Unix Makefiles'** if on Linux; choose **'XCode'** if on MacOS. Choose **'Visual Studio'** if on Windows. Then click OK to save.
36-
- Click **'Configure'** once again, then **'Generate'**.
36+
- Click **Configure** once again, then **Generate**.
3737
- Finally, on Windows or MacOS, click **Open Project** for building in respective IDE. On Linux desktop, open build folder, then run `make all` in Terminal.
38+
39+
### Important:
40+
41+
For macOS-specific guide with XCode, please [cmake/README.md](cmake/README.md)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if (NOT APPLE)
1313
set(SFML_STATIC_LIBRARIES TRUE)
1414
endif()
1515

16-
# write app version ONCE into Header
16+
# write app version into Header
1717
configure_file(
1818
${CMAKE_CURRENT_SOURCE_DIR}/src/proto_schema/AppVersion.hpp.in
1919
${CMAKE_CURRENT_SOURCE_DIR}/src/AppVersion.hpp

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# space - checkers
22

33
Offline & Online Multiplayer Checkers game in C++ built with SFML 2.6, imGui, Protobuf and ixWebsockets. With very minimal dependencies
4-
and a simple build process. All dependencies are auto-downloaded (compressed as `.tar.gz`) and built for you using [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake).
4+
and a simple build process. All dependencies are auto-downloaded (as `.tar.gz`) and configured for you using [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake). The only dependency you need pre-installed on your OS is SFML 2.6.x (or newer).
55

6-
This game can connect to both Private and Public game servers. The Server project for this game is on a separate Git repo, [available here](https://github.com/Longwater1234/checkers-backend) which you can self-host! The only dependency you need pre-installed on your OS is SFML 2.6.x (or newer).
6+
7+
This game can connect to both Private and Public game servers. The Server project for this game is written in Golang, and is [available here](https://github.com/Longwater1234/checkers-backend) which you can self-host!
78

89
### Main Libraries Used
910

10-
- SFML 2.6
11+
- SFML 2.6.1
1112
- imGui-SFML
1213
- ixWebsockets
1314
- spdlog
@@ -16,8 +17,8 @@ This game can connect to both Private and Public game servers. The Server projec
1617

1718
## Requirements for Building
1819

19-
- C++17 (or newer) build tools.
20-
- Pre-built [SFML 2.6.x](https://www.sfml-dev.org/download/sfml/2.6.1/) binaries. (Must match your Compiler and OS)
20+
- C++17 (or newer) compiler.
21+
- Pre-built [SFML 2.6.x](https://www.sfml-dev.org/download/sfml/2.6.1/) binaries.
2122
- [CMake 3.20+](https://cmake.org/download/) or newer (GUI recommended)
2223

2324
### For Windows
@@ -26,7 +27,7 @@ This game can connect to both Private and Public game servers. The Server projec
2627
- MS Visual Studio 2022 or newer (NOT vscode), with "**Desktop C++ Development**" bundle.
2728
- Please download "Visual C++ 64bit" edition of SFML; ignore others.
2829
- Move your unzipped `SFML-2.6.x` folder to its own home, example: `C:/SFML/SFML-2.6.1`.
29-
- Edit **line 25** in [CMakeLists.txt](CMakeLists.txt), to set value `SFML_HOME` to folder path you moved SFML into (see previous step)
30+
- Edit **line 24** in [CMakeLists.txt](CMakeLists.txt#L24), to set value `SFML_HOME` to folder path you moved SFML into (from previous step)
3031

3132
### For macOS (x64 & arm64)
3233

@@ -58,10 +59,14 @@ This game can connect to both Private and Public game servers. The Server projec
5859

5960
- Luckily, Windows and macOS come with their **native SSL libs pre-installed**, so nothing more to do 😁
6061

61-
## Building Instructions
62+
## Build Instructions
63+
64+
Please see [BUILDING.md](BUILDING.md) for detailed instructions for each platform.
65+
66+
## Code Contributions
6267

63-
Please see [BUILDING.md](BUILDING.md) for detailed instructions. For macOS-specific guide with XCode, please [cmake/README.md](cmake/README.md)
68+
Pull requests are welcome! See GitHub Issues tab to help with new Features. Just kindly remember run `lint.sh` script before you git push. Also, for this project, header files should end with `.hpp`.
6469

65-
### License
70+
## License
6671

6772
[GPL v3](LICENSE) © 2024, Davis T.

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# TODO list
22

33
- [ ] (Online mode) Display countdown timer (40 s), waiting for player's move. Reset it when they make a move.
4-
- [ ] Record and list all previous moves and captures (for current match), in a scroll window.
4+
- [ ] Record and list all previous moves and captures (for current match), in a scroll panel.
55

66
### (Extras) Standard CJK font paths
77

dependencies/mbedtls.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
CPMAddPackage(
44
NAME mbedtls
5-
URL "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v2.25.0.zip"
5+
URL "https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v2.25.0.tar.gz"
66
VERSION 2.25.0
77
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
88
DOWNLOAD_ONLY ON

dependencies/simdjson.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Get simdjson 3.10.0
22
CPMAddPackage(
33
NAME simdjson
4-
URL https://github.com/simdjson/simdjson/archive/refs/tags/v3.10.0.tar.gz
4+
URL "https://github.com/simdjson/simdjson/archive/refs/tags/v3.10.0.tar.gz"
55
VERSION 3.10.0
66
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
77
)

src/AppVersion.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef APP_VERSION_HPP
22
#define APP_VERSION_HPP
33

4+
// AUTO-GENERATED BY CMAKE, DO NOT EDIT!
5+
46
// clang-format off
57
namespace chk {
68
constexpr const char* APP_VERSION = "1.0.10";

src/WsClient.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class WsClient final
6161
std::atomic_bool connClicked = false; // if 'connect' button clicked
6262
std::vector<chk::ServerLocation> publicServers; // list of public servers (fetched from CDN)
6363

64+
/* callbacks for different events from server */
6465
onConnectedServer _onReadyConnected;
6566
onReadyStartGame _onReadyStartGame;
6667
onDeathCallback _onDeathCallback;

src/managers/OnlineGameManager.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ inline void OnlineGameManager::startCaptureListener()
498498
gameMap.erase(payload.details().hunter_src_cell()); // set opponent's old location empty!
499499
gameMap.erase(payload.details().prey_cell_idx()); // set my old location empty!
500500
gameMap.emplace(payload.destination().cell_index(), hunterPieceId); // fill in hunter new location
501-
int targetId = payload.details().prey_piece_id(); // get the target dead piece
501+
const int targetId = payload.details().prey_piece_id(); // get the target dead piece
502502
myTeam->losePiece(static_cast<short>(targetId)); // I will lose one piece
503503

504504
const int destCellIdx = payload.destination().cell_index();

0 commit comments

Comments
 (0)