A redesign of 'WordGrid' in Rust & WebAssembly, eventually featuring both single- & multi- player.
Find a file
2025-01-12 14:04:09 -08:00
resources fix: Remove some invalid dictionary words 2025-01-12 14:04:09 -08:00
server chore: Ran cargo fmt 2024-12-28 22:35:59 -08:00
ui fix: CSS layout fix that caused overlapped text 2025-01-12 13:50:56 -08:00
wasm fix: Use standard JSON output for WASM to match server output 2024-12-28 22:36:17 -08:00
wordgrid chore: Misc. fixes & tweaks 2024-12-27 14:30:06 -08:00
.gitignore fix: Dockerfile 2024-12-27 12:24:07 -08:00
Cargo.lock fix: Dockerfile 2024-12-27 12:24:07 -08:00
Cargo.toml Multiplayer (#1) 2024-12-26 18:38:23 +00:00
Dockerfile fix: Dockerfile 2024-12-27 12:24:07 -08:00
LICENSE Add LICENSE and fields to Cargo.toml 2023-08-20 16:28:42 -07:00
Makefile Adjust Makefile so 'make' builds all 2023-10-13 21:16:16 -07:00
README.md docs: Update documentation 2024-12-26 10:54:56 -08:00

README

This repository contains the code for 'WordGrid', a browser game where you use letter tiles to form words.

There is support for both multiplayer and singleplayer, where singleplayer runs entirely in the browser through WebAssembly.

Here's the rough layout of the repository:

  1. The core game logic resides in the wordgrid/ folder as Rust code and is a library for either the wasm/ code (if compiled to WebAssembly for singleplayer), or for the server/ code (if used in multiplayer).
  2. The Rust code in wasm/ is a small compatibility layer between the library and the browser. It gets compiled using wasm-pack to a Node package into wasm/pkg/ that gets read by ui/
  3. ui/ is a Node package that uses React & Typescript. Currently it assumes it's being run in an environment that supports both singleplayer & multiplayer. This can't be built until the wasm/ code has been built.
  4. server/ is a Rust program that runs a small web server for multiplayer purposes.

If you want to try it now, I host a version at https://wordgrid.joeltherrien.ca

Setup

I'd suggest just reading through the Dockerfile to precisely see what to do, but it's basically the following steps:

  1. Ensure you have Rust, Node, npm, and wasm-pack installed.
  2. Build wasm by navigating to the wasm/ folder and running wasm-pack build --target=web
  3. Build the ui by navigating to the ui/ folder and running npm run build. You may need to first run npm install.
  4. Build the server by navigating to the server/ folder and running cargo build --release.

If you just want singleplayer, you can stop after step 3 and the static files you'll want are in ui/dist/. You can rename singleplayer.html -> index.html if you want to save a click.