Let’s create a tank game in Unity + MUD!

NOTE: This tutorial uses the optional studio-mud package, you can remove it from the Unity package manager and interact directly with UniMUD!

Project setup

This tutorial assumes you have already installed all the prerequisites.

  1. First, clone the Tankmud tutorial branch.
    1. git clone -b tankmud-tutorial <https://github.com/emergenceland/UniMUD.git>
    2. If you want to see the finished code, switch to the main branch.
  2. Open up a terminal and navigate to templates/tankmud/
  3. Run pnpm install to install MUD
  4. Open packages/contracts/ in your preferred code editor.

We’re ready to begin creating our onchain logic.

Contracts

Setting up tables

Open mud.config.ts from the contracts folder

We want tanks to do 2 things: move and attack. This means we need the following components/tables.