project screenshot 1
project screenshot 2
project screenshot 3

3card poker

"Game 3Card Poker" is an online blockchain-based game where players can choose to view their own cards. The cards they have seen are displayed openly. Players are required to place their chips into the central prize pool on the table.

3card poker

Created At

ETHOnline 2023

Project Description

"Game 3card Poker" is a Web3-based smart contract game where players can authorize login using their Metamask wallet addresses. First-time registered users receive initial tokens, which are stored on the blockchain. If the game tokens are insufficient, players can exchange them through the platform's purchasing method. The game starts with dealing cards and ends by recording changes in token values, all of which are submitted to the blockchain, ensuring transparency and verifiability throughout the gaming process.

The detailed operational process of the game is as follows: Click "Connect Wallet" to connect the wallet. Select MetaMask from the pop-up window. Click "Sign" to complete the signature. Choose the number of players in "PLAYERS". Specify the minimum bet amount for the game in "LOW BET CHIPS". Specify the maximum bet amount for the game in "TOP BET CHIPS". Specify the total number of rounds for the game in "TOTAL ROUNDS". Click "CREATE A GAME" to create the game. After successful creation, click the link button in the upper right corner and click "COPY LINK" in the pop-up box to copy the invitation link. After entering the game, click "READY" to prepare. The host clicks "START" to start the game and put the card value data on the chain. Click "CHECK" to view your own cards. Click "CALL" to follow the bet. Click "RAISE" to raise the bet. Click "HEADS-UP", and then click on other users again to compare cards. "PK LOSE" indicates losing the card comparison. Click "FOLD" to discard the cards. When there is only one player left on the field, the game ends, and the game results are displayed, and the data is submitted to the chain.

How it's Made

"Game 3Card Poker" is a traditional card game implemented through a web3 contract. The contract primarily covers game account management, storage of dealt card values, game termination handling, as well as withdrawal and recharge functionalities. These functionalities ensure smooth gameplay and secure management of user accounts.

On the server side, it is built using the Go language and the WebSocket protocol to allow users to access game rooms. The server broadcasts game status and player actions through message broadcasting, handles asynchronous events using a delay queue, and employs polling and caching to enhance performance. Game data is reliably stored on the blockchain. Additionally, a monitoring system is established to monitor server operation status, ensuring stable gameplay and the swift resolution of issues.

background image mobile

Join the mailing list

Get the latest news and updates