# StarkLudo
Ludo game, on Starknet
## What is StarkLudo?
StarkLudo is a classic board game enjoyed by people of all ages. It’s a game of chance and strategy, where players race their game pieces around the board to be the first to reach the finish spot.
At the start of the game, all players are assigned 4 pieces each. The goal is to move all four pieces to the finish spot through a specific route on the board. Each piece is moved one at a time. Each player takes turn rolling a die, and the output of rolling the die determines how many steps forward a piece can move. The first player that moves all their 4 pieces to the finish spot is declared the winner.
The game can be played by either 2, 3 or four people. In each game, there can only be one loser. For example, if the game is played by 4 people, the first 3 players to reach the finish spot are the winners. The player that reaches first gets the first position, the player that reaches second gets the second position, and the third gets the third position.
## Features
1. Multiplayer
2. Tournament Mode
3. Leader Board/ game ranking
4. NFT rewards for each game played
5. Customisable game appearance
## Gameplay and Rules
### Rolling the Dice
Players take turns rolling the dice and moving their pieces according to the number rolled. Each piece starts in the home area.
### Safety Zones
There are safety zones on the board where players’ pieces cannot be captured. The finish line is also a safety zone.
### Rules
- Rule 1: The game starts with each player choosing a set of four pieces (usually colored red, blue, green, and yellow) and placing them on the starting square.
- Rule 2: The objective of the game is to move all four pieces around the board and return them to the starting square before your opponents.
- Rule 3: On each turn, players roll two dice to determine how many spaces they can move their pieces.
- Rule 4: The number on each die represents how many spaces a piece can move. For example, if a player rolls a 3 and a 6, they can move one piece 3 spaces and another piece 6 spaces.
- Rule 5: Pieces can only move forward, never backward.
- Rule 6: If a piece lands on a square occupied by an opponent’s piece, it can “knock off” that piece and send it back to the starting square.
- Rule 7: A piece can only be moved to a square that is empty or occupied by an opponent’s piece.
- Rule 8: If a player rolls a double (two 6s), they can move one piece the total number of spaces shown on the dice (e.g., 6 spaces for two 3s).
- Rule 9: if a player 3 pieces reached Home, only one is left. and the piece reached the home column. A person should be shifted to one Dice, if the player wants to play with 2 dice he/she gets the exact number which in the case of one, is not possible
- Rule 10: If a player has no pieces on the board, they can only roll the dice to try to get a double, which allows them to enter a piece into play.
- Rule 11: The game ends when one player has all four pieces back on the starting square. That player is the winner.
## Game Componenents
1. Account
2. Leaderboard
3. Multiplayer
4. Game apperance
### 1. Account

The account component is made up of Wallet and Profile.
#### Wallet
- Details about the connected Starknet wallet
- They includes wallet address, Starknet ID, Network, and other helpful details about the connected wallet
#### Profile
- This is the list of profiles the player has created
- A single connected wallet can have unlimited number of profiles
- Each profile is an [Non-fungible Tokenbound Account](https://tokenbound.gitbook.io/starknet-tokenbound) the player uses to interact with the game
- All game data of that player is stored in the tokenbound account
- The player can use this profile to perform other actions like purchase game assets, claim NFT rewards and other game rewards from game play, transfer game assets to other players, etc
### 2. Leaderboard
Leaderboard.
### 3. Multiplayer
Multiplatyer.
### 4. Game apperance
Game appearance.
## Starknet wallet, NFT, and Tokenbound account Relationship in StarkLudo
How StarkLudo integrates these various components together:
1. Connect Starknet wallet
2. Create profile name
3. Mint new NFT and assign profile name to NFT Id using the `NFTNameResolver` contract
4. Create new Tokenbound account using the same NFT Id assigned to profile name
5. The profile name now resolves the newly created Tokenbound account
> - princeibs (profile name) -> 999 (token id) -> 0x12342 (tokenbound account)
> - _therefore_, princeibs -> 0x12342
> User can create as many profile name as desired, and therefore create as many tokenbound account as desired
