-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a card-game Aztec noir example #1463
Comments
This one's not getting done by our deadline likely. The card game logic proved labour intensive to test, and I probably switched to it too late. I would simplify it to some e.g. high card game, but is that sufficiently different from the other examples? I could probably finish it with a few days. |
iAmMichaelConnor
modified the milestones:
🚀 Initial Aztec Sandbox Release,
📢 Initial Public Sandbox Release
Aug 25, 2023
ludamad
changed the title
Finish offsite card game example.
Create a card-game Aztec noir example
Sep 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Finish the card game, specifically the following logic should be done:
Parameters for now:
Asynchronously, people
buy_pack
to get all the latest chase CGAM cards. CGAM cards have a randomstrength
and a randompoints
. Strength is good, it helps you win. Points are bad, they give your opponent points. These are both independently random variables.At some point, when they have at least NUMBER_OF_CARDS_DECK, they can join_game().
When they join_game(), we want to take stock of their total deck strength while not revealing their cards. The person with the highest total deck strength will go last. (Note there's a flaw here as the first person to queue a public call is at a disadvantage, we're just ignoring this, could have an extra phase later)
Once NUMBER_OF_PLAYERS has been reached, the game starts. The players move in turn order calling
play_card
(can hardcode this for 2 players for now) based on their deck strength. Once you see their action, you reveal a card in your deck and presumably try to beat their strength. The person who wins the round gets the number of points. Once we have NUMBER_OF_CARDS_DECK rounds, we see which person has the most points, and declare them the winner. All cards in both decks are given to the winner.Entry points:
private buy_pack
: A person is able to buy a random pack privately. They get NUMBER_OF_CARDS_PACK cards inserted into their private NFT collection.private queue_join_game
: Signal privately intent to join a specified game, computing the deck strength and commiting to the deckpublic internal join_game
: Join a specified game, committing to their decks and deck strength and modifying game data structures that set up for start_game to identify all players and their decks.public internal start_game
: Start a specified game, creating structures necessary to keep track of who's turn it is, who is in the game, and how many points they currently have.public play_card
: For a specific game if it is your turn, reveal a card from your deck, proving you own it, and nullify it. If you are the last person in a round, resolve that round based on who has the highest strength card. You then get the sum of points of all the other cards.public end_game
: Once NUMBER_OF_CARDS_DECK rounds have passed, mint all played cards from opponents to the winner (they have been nullified at this point).We want a test with 2 players and 2 card decks that play 2 rounds in the game, and successfully have the winner then play a new opponent with his minted cards.
The text was updated successfully, but these errors were encountered: