*
Dojo est un moteur de jeu et une suite d'outils éprouvés pour créer des jeux 'on-chain' et des mondes autonomes avec Cairo.
curl -L https://install.dojoengine.org | bash

Architecturez votre World

Commencez à coder en Cairo. Voici un exemple.

Read the Dojo Book
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #[dojo::contract] mod player_actions { use starknet::{ContractAddress, get_caller_address}; use super::{Position, Vec2}; use super::IPlayerActions; #[external(v0)] impl PlayerActionsImpl of IPlayerActions<ContractState> { fn spawn(self: @ContractState) { // Access the world dispatcher for reading. let world = self.world_dispatcher.read(); // get player address let player = get_caller_address(); // dojo command - get player position let position = get!(world, player, (Position)); // dojo command - set player position set!(world, (Position { player, vec: Vec2 { x: 10, y: 10 } })); } } }

Partners