- git (download (opens in a new tab))
- foundry (forge, anvil, cast) (download (opens in a new tab), make sure to
foundryupat least once)
- node.js (v17+) (download (opens in a new tab))
- pnpm (
npm install pnpm --globalafter installing node)
Most projects in MUD are started by running
pnpm create mud <project name>, but for this tutorial we've included some initial code to get you up and running quicker. This includes React components and base TailwindCSS styles.
Fork or clone from the Emojimon starter kit repo (opens in a new tab). You can use the command below.
git clone https://github.com/latticexyz/emojimon.git -b mud-update-next-14
Install the dependencies and start up the MUD services (anvil node, contracts deployer, and client).
cd emojimon && pnpm install && pnpm run dev
At this point you can play the game to see the finished game. Open the game in your browser. By default the game is at http://localhost:3000 (opens in a new tab), but it could be on a different port if that port's taken.
Click the map to spawn at a specific location and move using the arrow keys. Note that on each block you can only move one space, and the block time on the anvil blockchain is one second.
Now that you've seen our end goal, reset the repository to the starting snapshot (opens in a new tab).
git reset --hard 8520a8206929f6265609cc9166c985846fd0cd87
After you do this, the game is just a green area where the map is going to be.
Except for a few utility files, most of the code is in two packages: