Skip to content

cryptomaestro2888/cc-dojo-map

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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

  • Player
  • Map

Systems

  • Movement

Split into several stages

  • 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

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 --name cc_dojo_map  
  1. Indexer
torii --world WORLD_ADDRESS
  1. Invoke the contract:
sozo execute CC_CONTRACT_ADDRESS test

build client

1.Build the frontend:

cd client
yarn

2.Run:

yarn dev

3.Open the following link and use the 'WASD' keys to control movement:

http://localhost:5173/

Project Structure

Name Description
client for testnet c&c
client3 for katana c&c

Version Check

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 83.9%
  • Cairo 10.0%
  • CSS 3.7%
  • Shell 1.4%
  • Other 1.0%