How to Use Our ECS Project
1) Create Demo Project Using Command
To create a demo project, you typically use a command-line tool or script. You can use the scaffolding command we provide to initialize the project. You can use the following command:2) Add Tables and Contracts
To add a table and contract, you need to define them in your configuration and codebase. For example, in yourmud.config.ts file, you define tables like this:
src/systems or src/codegen directories and define your contract logic there.
3) How to Generate Automated Code
Automated code generation can be done using scripts or tools that read your configuration and generate the necessary code files. In your setup, this might involve running a build script that uses themud tool to generate code based on your mud.config.ts.
4) Modify Heartbeat Contract
To modify a heartbeat contract, you would typically edit the Solidity file where the contract is defined. The heartbeat mechanism might be implemented in a contract that periodically triggers certain actions, such as refreshing game state or generating new game elements.5) How to Compile and Deploy
To compile and deploy your contracts, you can use the scripts defined in yourpackage.json. For example, you might have scripts like these:
- Compile: Run
npm run buildorpnpm run buildto compile your contracts. - Deploy: Use
npm run deploy:devornpm run deploy:prodto deploy your contracts to the desired network.

