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.
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);
}
- Player
- Map
- Movement
- Parsing CC map data using Cairo, which can depend on the CC library
- Implementing new map generation based on the CC library, without using the mint form
- Allowing the player to move on the map and interact with local katana
- Implementing points of interest and teleportation points
Omitting the installation of Rust, Cairo, and Scarb.
- Clone the source code:
git clone https://github.com/CheDAOLabs/cc-dojo-map.git- Execute the script, specifying the Dojo version:
dojoup- Start Katana:
katana --disable-fee --invoke-max-steps 4294967295- Compile the contract:
sozo build- Deploy the contract:
sozo migrate- Indexer
torii --world WORLD_ADDRESS- Add auth
cd scripts & sh default_auth.sh & sh cc_auth.sh- Invoke the contract:
sozo execute CC_CONTRACT_ADDRESS testcd client3
yarn
yarn devhttp://localhost:5173/| Name | Description |
|---|---|
| client | for testnet c&c |
| client3 | for katana c&c |
| Name | Version | Compatibility Dojo version | Coments |
|---|---|---|---|
| cc-dojo-map | v0.1.0 | v0.2.3 | testnet C&C integrated into Dojo |
| cc-dojo-map | v0.2.0 | v0.3.0-rc9 | update dojo to v0.3.0-rc9 |
| cc-dojo-map | v0.2.1 | v0.3.0 | update dojo to v0.3.0 |
| cc-dojo-map | v0.3.0 | v0.3.0 | C&C deployed in Katana |
| cc-dojo-map | v0.3.15 | v0.3.15 | update dojo to v0.3.15 |
| cc-dojo-map | v0.4.0 | v0.4.0 | update dojo to v0.4.0 |
| cc-dojo-map | v0.4.2 | v0.4.2 | update dojo to v0.4.2 |

