Skip to content

Commit

Permalink
Merge pull request #53 from dojoengine/starter-update
Browse files Browse the repository at this point in the history
Update comments on dojo-starter
  • Loading branch information
gianalarcon authored Apr 8, 2024
2 parents ec48ac1 + 1eb0f75 commit b08f054
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ rpc_url = "http://localhost:5050/"
# Default account for katana with seed = 0
account_address = "0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca"
private_key = "0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a"
world_address = "0x446f1f19ba951b59935df72974f8ba6060e5fbb411ca21d3e3e3812e3eb8df8"
world_address = "0x446f1f19ba951b59935df72974f8ba6060e5fbb411ca21d3e3e3812e3eb8df8" # Update this line with your world address

[tool.dojo.world]
name = "Dojo starter"
Expand Down
12 changes: 6 additions & 6 deletions src/systems/actions.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ mod actions {

use starknet::{ContractAddress, get_caller_address};
use dojo_starter::models::{position::{Position, Vec2}, moves::{Moves, Direction}};
// // declaring custom event struct

// declaring custom starknet event
// #[event]
// #[derive(Drop, starknet::Event)]
// enum Event {
// Moved: Moved,
// }

// // declaring custom event struct
// declaring custom event struct
// #[derive(starknet::Event, Model, Copy, Drop, Serde)]
// struct Moved {
// #[key]
Expand All @@ -40,7 +40,7 @@ mod actions {
let position = get!(world, player, (Position));

// Update the world state with the new data.
// 1. Increase the player's remaining moves by 1.
// 1. Set the player's remaining moves to 100.
// 2. Move the player's position 10 units in both the x and y direction.
set!(
world,
Expand Down Expand Up @@ -71,11 +71,11 @@ mod actions {
// Calculate the player's next position based on the provided direction.
let next = next_position(position, direction);

// // Update the world state with the new moves data and position.
// Update the world state with the new moves data and position.
set!(world, (moves, next));
// Emit an event to the world to notify about the player's move.
// emit!(world, Moved { player, direction });
emit!(world,( Moves { player, remaining, last_direction: direction }));
emit!(world, (Moves { player, remaining, last_direction: direction }));
}
}
}
Expand Down

0 comments on commit b08f054

Please sign in to comment.