A battleship game built using .NET 8, Raylib-cs for the client-side graphics, and LiteNetLib for networking.
The solution (WaterWizards.sln) contains the following projects:
- WaterWizard.Client: The game client using Raylib-cs for rendering and LiteNetLib for communication. (Program.cs)
- WaterWizard.Server: The game server using LiteNetLib to handle game logic and client connections. (Program.cs)
- WaterWizard.Shared: A shared library containing common code (e.g., network messages, game state) used by both the client and server.
- .NET 8 SDK
-
Clone the repository (if you haven't already):
git clone SSH <repository-url> cd WaterWizards
-
Build the solution:
dotnet build WaterWizards.sln
-
Run the Client:
dotnet run --project src/WaterWizard.Client/WaterWizard.Client.csproj
-
Run the Server:
dotnet run --project src/WaterWizard.Server/WaterWizard.Server.csproj
- Raylib-cs (Client)
- LiteNetLib (Client, Server, Shared)
./start-game- Universal Script./start-game.sh- Bash Skript for a quick start with 2 clients and with a server
start-game.bat- Batch-Script for CMDstart-game.ps1- Powershell-Script
./start-game.\start-game.ps1./start-game.bat./start-game.shCTRL + CScripts are creating log files:
server.log- Server-Logsclient1.log- Client 1 Logsclient2.log- Client 2 Logs
❌ Build failed! Please fix the errors and try again.Solution: Fix the build errors
❌ Server failed to start. Check server.log for details.Solution: Check the server.log for detailed logs.
Symptom: Server or Client can't connect to each other Solution:
- Check if port 7777 is available
- End other dotnet-process
- Use
netstat -an | grep 7777(Unix) ornetstat -an | findstr 7777(Windows)
dotnet run --project src/WaterWizard.Server/WaterWizard.Server.csproj- In the server directory run:
docker compose up --builddotnet run --project src/WaterWizard.Client/WaterWizard.Client.csproj| Plattform | Recommended Script | Alternative |
|---|---|---|
| macOS | ./start-game |
./start-game.sh |
| Linux | ./start-game |
./start-game.sh |
| Windows | start-game.ps1 |
start-game.bat |