Skip to content

Latest commit

 

History

History
44 lines (27 loc) · 1.69 KB

labyrinth-board-game-using-webrtc2.md

File metadata and controls

44 lines (27 loc) · 1.69 KB
title slug createdAt coverImage preview description tags
Labyrinth board game using WebRTC
8-labyrinth-board-game-using-webrtc
2022-11-13
/content-assets/7/cover.png
false
Peer-to-peer Labyrinth board game hosted on the player's browser.
typescript
game
webrtc

Labyrinth board game

One Saturday evening, we were enjoying the weekend and playing Labyrinth the board game. It's a surprisingly fun game even for adults due to its mechanics. There's certainly luck involved but the game decently rewards for route calculation skills.

The most dreading part of the game is the initial shuffling of pieces. Often when my wife seemed happy with the piece positions, I noticed having a few extra strict rules for the initial board. To figure my brain's shuffling rules, I wrote them down:

  1. Each player should be tightly cornered at the start.
  2. There should be minimal amount of already connected paths.

That summoned a lot of questions.

What's the maximum length of connected pieces you should aim for? What would be a good shuffling algorithm? Is it even possible to go as low as maximum 2 pieces connected?

That's what we're about to find out!

Let's get coding

To answer these questions, we obviously need to build the whole game as a React app first.

Geeky hobbies has a good overview of the game play and its rules.

Online version of the Labyrinth board game. The game server runs on the host's browser and networking happens peer-to-peer.