A polished Battleship game built with .NET MAUI and a shared C# game core. This repository now publishes 2 separate Windows apps from the same codebase:
BattleshipMaui: the original single-player release against the onboard CPU.LANBattleshipMAUI: a dedicated same-network multiplayer release for 2 Windows PCs on the same LAN.- Both releases now launch in borderless full screen, play a cinematic startup sequence on a true full-screen black intro layer, and use
Escfor the in-game command menu. - Both releases now layer a slower drifting ocean backdrop behind the UI and render the boards as translucent tactical glass over moving water with sonar ripples on cell taps.
- Both releases now delay the ocean-backdrop animation startup until after first window show so the main app window opens visibly again while keeping the moving water effect and
F11full-screen support. - Press
F11in either release to toggle true Windows full-screen mode on or off after launch.
- Current solo public app release:
BattleshipMaui v1.9.12 - Current LAN public app release:
LANBattleshipMAUI v2.2.12 - Release history and public-release notes: CHANGELOG.md
- Tag mapping:
v1.x.xpublishes the soloBattleshipMauiline.v2.x.xpublishes the LANLANBattleshipMAUIline.
- Public distribution format: self-contained Windows
win-x64zip
BattleshipMaui v1.9.12is in Public Release status.LANBattleshipMAUI v2.2.12is in Public Release status.
- Original single-player Battleship against the computer enemy
- Borderless full-screen launch with cinematic startup title cards driven by the supplied
Echo_startup.wav,VS_Code_startup.wav, andTitle.wavfiles, now isolated from the live dashboard on a true full-screen black intro layer with a cleaned VS Code logo card and a larger zooming title reveal - A more realistic animated ocean treatment with a slower drifting full-screen sea backdrop, deeper board-water lighting, a translucent glass command-board shell, and blue sonar ripple feedback on grid taps
- The solo CPU targeting prelude now roams smoothly across the player board as a free-floating reticle instead of hopping cell-to-cell before locking the final shot
- Manual fleet placement with hover preview and right-click rotation
- Enlarged combat boards with compact in-game chrome so the window stays focused on the 2 boards
- Default turn-cinematic strike overlay now uses a lighter floating thinking bubble while the CPU reticle roams your board for
2-4seconds before it locks the chosen cell with the suppliedTarget_Locked.wavcue - Supplied commander voice clips now cover hit, miss, enemy destroyed, player vessel destroyed, victory, defeat, and draw outcomes
- Win, draw, and loss end-state callouts now select randomly from their supplied outcome clip pools instead of always using the same order
- Background music now ducks to
2%during gameplay audio playback, then restores to the player-selected volume Esccommand menu now holds the former settings panel plus mission controls during play, includingQuit- Adjustable CPU difficulty from the
Esccommand menu - Startup visuals now remove the stray intro guide marks, render the VS Code logo card correctly, and use a larger
MAUI/Battleshiptitle reveal with layered depth, crack accents, and backlit glow - Windows startup now uses the stable pre-
v1.9.8full-screen activation flow so the published.exeopens with a visible WinUI window again instead of staying hidden in the background - Persistent stats, post-game recap, music, FX, and visual themes
- Dedicated LAN release for 2 players on the same local network
- Borderless full-screen launch with cinematic startup title cards driven by the supplied
Echo_startup.wav,VS_Code_startup.wav, andTitle.wavfiles, now isolated from the live dashboard on a true full-screen black intro layer with a cleaned VS Code logo card and a larger zooming title reveal - A more realistic animated ocean treatment with a slower drifting full-screen sea backdrop, deeper board-water lighting, a translucent glass command-board shell, and blue sonar ripple feedback on grid taps
- Host/join flow directly in the app header
- Private local fleet placement on both PCs
- Placement layout tuned so rows
IandJremain visible while deploying fleets - Enlarged combat boards, optional turn-cinematic strike overlay, supplied commander voice hit/miss/destroyed plus win/loss/draw callouts, and a hit-only intel bubble pop-up after animated impacts
- Win, draw, and loss end-state callouts now select randomly from their supplied outcome clip pools instead of always using the same order
- Background music now ducks to
2%during gameplay audio playback, then restores to the player-selected volume Esccommand menu now holds the former settings panel plus mission controls during play, includingQuit- Game-over debrief now keeps the compact combat header and reduced battle-board scale so rows
IandJremain visible behind the overlay in both releases - Startup visuals now remove the stray intro guide marks, render the VS Code logo card correctly, and use a larger
MAUI/Battleshiptitle reveal with layered depth, crack accents, and backlit glow - Windows startup now uses the stable pre-
v2.2.8full-screen activation flow so the published.exeopens with a visible WinUI window again instead of staying hidden in the background - Synced alternating turns, synced rematch via
New Mission, and session disconnect support
- .NET 10
- .NET MAUI (Windows target currently configured)
- C# game engine in
Battleship.GameCore - xUnit test project in
BattleshipMaui.Tests
Battleship.GameCore/: game-domain logic (GameBoard, ships, attacks, results)ViewModels/: gameplay state, turn loop, placement, AI, LAN session flow, stats persistenceBehaviors/: UI animation behavior for reveal and board effectsMainPage.xaml: full game UIBattleshipMaui.Tests/: unit tests for board rules, AI targeting, and LAN view-model flow
- Clone the repository.
- Open in Visual Studio 2022+ with the MAUI workload installed.
- Build and run the flavor you want.
CLI alternatives:
dotnet build BattleshipMaui.sln
dotnet run --project BattleshipMaui.csproj
dotnet run --project BattleshipMaui.csproj -p:AppFlavor=Landotnet run --project BattleshipMaui.csprojlaunches the soloBattleshipMauibuild.dotnet run --project BattleshipMaui.csproj -p:AppFlavor=Lanlaunches the dedicatedLANBattleshipMAUIbuild.
Publish one flavor:
.\scripts\Publish-WindowsZip.ps1 -AppFlavor Solo
.\scripts\Publish-WindowsZip.ps1 -AppFlavor LanPublish both public releases together:
.\scripts\Publish-PublicReleases.ps1This creates:
artifacts\release\BattleshipMaui-v1.9.12-win-x64.zipartifacts\release\BattleshipMaui-v1.9.12-win-x64.sha256artifacts\release\LANBattleshipMAUI-v2.2.12-win-x64.zipartifacts\release\LANBattleshipMAUI-v2.2.12-win-x64.sha256
After extracting the zips, launch:
BattleshipMaui-v1.9.12-win-x64\BattleshipMaui.exeLANBattleshipMAUI-v2.2.12-win-x64\LANBattleshipMAUI.exe
The public zips are built as:
.NET self-containedWindowsAppSDKSelfContained=true- unpackaged Windows desktop output
Use the dedicated LAN build: LANBattleshipMAUI v2.2.12.
- Put the same published LAN zip on both PCs.
- Extract the zip on both PCs and launch
LANBattleshipMAUI.exe. - Make sure both machines are on the same router or switch.
- On the host PC:
- Leave the default port
47652or choose another unused port. - Note one of the LAN IPs shown in the header.
- Click
Host LAN.
- Leave the default port
- On the joining PC:
- Enter the host PC's LAN IP in
Host IP. - Enter the same port number.
- Click
Join LAN.
- Enter the host PC's LAN IP in
- Both players place fleets locally on their own PC.
- The host fires the first shot after both fleets are ready.
- Use
New Missionfor a synced rematch andDisconnectto close the LAN session.
During LAN play:
- The game starts in borderless full screen and plays the startup intro automatically.
- Press
Escduring the intro to skip straight to the game. - Press
Escduring play to open or close the command menu. - Use
Quitin theEsccommand menu to close the app directly. - Press
F11to toggle true full screen on or off at any time. Turn Cinematic Overlaycan be toggled in theEsccommand menu.- The default LAN behavior keeps rapid-fire turn flow enabled when cinematics are off.
- When cinematics are on, incoming and outgoing strikes get a full-screen targeting overlay before the shot resolves.
- LAN hit results also show a short intel bubble after the animation. Misses do not trigger that bubble.
If the connection fails:
- Make sure the host IP is the host PC's local network address, not a public internet IP.
- Allow
LANBattleshipMAUI.exethrough Windows Firewall on private networks if Windows prompts. - Confirm both PCs are running the same published LAN build.
- Press
New Mission. - Let the startup sequence finish, or press
Escto skip it. - Place all ships on
Your Fleet. - Fire on
Enemy Waters. - Watch the default strike cinematic resolve the exchange, then continue the battle.
- Alternate turns against the CPU until one fleet is sunk.
- Use
Escto open the command menu for CPU difficulty, commander voice, turn cinematics, music, and accessibility settings.
- Complete the steps in LAN Session Setup.
- Let the startup sequence finish, or press
Escon either PC to skip it. - Place all ships on both PCs.
- The host fires first.
- Leave rapid-fire pacing on for instant handoff turns, or enable turn cinematics in the
Esccommand menu for a slower dramatic strike reveal. - Alternate turns until one fleet is sunk.
- Use
New Missionto start a synced rematch.
New Mission: resets boards and starts a new missionReset Stats: clears saved cumulative statsHost LAN: starts listening on the selected port inLANBattleshipMAUIJoin LAN: connects to the host PC by LAN IP and matching port inLANBattleshipMAUIDisconnect: closes the current LAN session inLANBattleshipMAUIEsc: skips the intro sequence or opens/closes the in-game command menuQuit: closes the app from theEsccommand menuTheme Shiftand the theme picker: switch among 10 visual themesF11: toggles true Windows full-screen mode on or offTurn Cinematic Overlay: enables or disables the animated strike transitionCommander Voice: enables or disables the supplied spoken battle callouts, including target lock, hit, miss, ship-destroyed, victory, defeat, and draw clips while temporarily ducking music to2%Rotateor right-click: rotates the selected ship during placement
Run the default solution test pass:
dotnet test BattleshipMaui.slnRun the LAN-flavor test pass:
dotnet test BattleshipMaui.Tests\BattleshipMaui.Tests.csproj -p:AppFlavor=LanRun the CI core subset:
dotnet test BattleshipMaui.Tests\BattleshipMaui.Tests.csproj --filter "Category=Core9"- Core tests workflow:
.github/workflows/core-tests.yml - Public Windows release workflow:
.github/workflows/windows-release.yml - Push
v1.x.xtags for the solo public release. - Push
v2.x.xtags for the LAN public release.
This project is licensed under the Business Source License 1.1 (BSL). See LICENSE.md for full terms.
- Additional Use Grant: None
- Change Date: 2029-01-01
- Change License: Apache License 2.0
Battleship MAUI | Developed by JamesGillDev and contributors