Skip to content

Conversation

@favourawaku
Copy link
Contributor

This PR adds the create_new_game function to the Blockopoly smart contract, enabling registered players to initiate new game instances on-chain. The function validates that the caller is registered, ensures the number of players is between 2 and 8, and assigns the initiating player their chosen symbol. It generates a unique game ID, captures the current timestamp, and initializes the game with appropriate metadata and player details. Depending on the game mode, the game status is set to either Pending (multiplayer) or Ongoing (single-player). The new game instance is saved to the world state, and a GameCreated event is emitted to record the creation. This feature is essential to the decentralized game setup flow in Blockopoly. closes #2

@aji70 aji70 merged commit 7b24afa into SaboStudios:main May 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement create_new_game Function for Game Creation Logic

2 participants