Home

Awesome

This example is not a complete or fully functional implementation of the game. Instead, it is a basic demonstration that illustrates how to integrate C&C (Crypts And Caverns) into the game world.

demonstrate

demonstrate

demonstrate

crypts and caverns example

A simple game example

Requires Dojo to implement player movement

interface

#[starknet::interface]
trait ICryptsAndCaverns<TState> {

    fn owner_of(self: @TState, token_id: u256);

    fn get_svg(self: @TState, token_id: u256);

    fn generate_dungeon(self: @TState, token_id: u256);

    fn get_seed(self: @TState, token_id: u256);

    fn mint(ref self: TState);

}

Components

Systems

Split into several stages

How to build

Omitting the installation of Rust, Cairo, and Scarb.

build backend

  1. Clone the source code:
git clone https://github.com/CheDAOLabs/cc-dojo-map.git
  1. Execute the script, specifying the Dojo version:
dojoup
  1. Start Katana:
katana --disable-fee --invoke-max-steps 4294967295
  1. Compile the contract:
sozo build
  1. Deploy the contract:
sozo migrate
  1. Indexer
torii --world WORLD_ADDRESS
  1. Add auth
cd scripts & sh default_auth.sh & sh cc_auth.sh
  1. Invoke the contract:
sozo execute CC_CONTRACT_ADDRESS test

build client

Start the React app.

cd client3
yarn
yarn dev
http://localhost:5173/

Project Structure

NameDescription
clientfor testnet c&c
client3for katana c&c

Version Check

NameVersionCompatibility Dojo versionComents
cc-dojo-mapv0.1.0v0.2.3testnet C&C integrated into Dojo
cc-dojo-mapv0.2.0v0.3.0-rc9update dojo to v0.3.0-rc9
cc-dojo-mapv0.2.1v0.3.0update dojo to v0.3.0
cc-dojo-mapv0.3.0v0.3.0C&C deployed in Katana
cc-dojo-mapv0.3.15v0.3.15update dojo to v0.3.15
cc-dojo-mapv0.4.0v0.4.0update dojo to v0.4.0
cc-dojo-mapv0.4.2v0.4.2update dojo to v0.4.2