Dacplay is a dApp built on Ethereum, to provide frameworks and networks for dApp game developers. The token PLS could either be used as the cryptocurrency in these dApp games, or be used as collaterals to generate game chips in games.
All kinds of dApps could be developed using DACPLAY framework, including NFT crypto games like crypto kitties or pridiction games using random numbers etc. Here in this article, there will the first game released in beta version on dacplay, this game is developed by third-party developer with no server side, which means it is built only with web front-end and smart contracts.
Here is the entry of the game(Tip: The game needs 1000 PLS for each game, you can go Etherdelta to buy PLS):
Bet game, as the name says, it is an game for player to bet with counter-party. Every player can open a new round for others to join and bet, it does not need to use random number and absolute secure fair because the final result are generated by the secrets provided by players. Each player has the desire to keep their secret safe and private because otherwise counter-parties will have way to game with it and make you lose the game. The rules of game is public and transparent on the blockchain, no centralized roles can control the game, change the rules, or cheat. This is the greatest charm part of dacplay dApp games. If you want to take a look at the detail rule or code of the game, you can go to etherscan to audit it:
Here is the introduction from game page:
Bet Game is separated to a list of rounds, for every round, every player will join in by putting an bet here, the contract will automatically calculate a game result according to the secret of these bets, which is an odd or an even, according the sum of the secrets of the bets. Every player will get reward according to their guess settings in the origin bet, they will win and get reward if they guess the right answer, otherwise they will lose.
Every one can trigger the round finalization action once all bets are full filled and all bets are revealed. But if someone forget to reveal the bet in specific time(there will one round parameter controlling this: _maxRevealBlockCount), the round will fail to reveal, the funds of the players who revealed will be returned back, but the funds of players who didn't reveal in time will be punished and be confiscated to the finalizer and contract owner.
There are some import parameters need to set:
- 1. The total "betCount" that will happen in the round, which means the how many bets should be played for this round. The player who start a new round(room),and join with his bet can use "startRoundWithFirstBet". The suggested betCount for easy to find counter-party player, is just 2.
- 2. The parameters of one round includes:
- a. _betCount, the count of the bets.
- b. _maxBetBlockCount, the max waiting bet count till finalizing the round, that is, anyone can finalize the round after "_maxBetBlockCount" from the first bet.
- c. _maxRevealBlockCount, not implemented, supposed to be the max waiting reveal block count till finalizing the round, that is, anyone can finalize the round after "_maxRevealBlockCount" from the last bet block.
- d. _secretHashForFirstBet, this is the hash of the guess and secret settled by the player, which is also the result of "calculateSecretHash(uint _nonce, bool _guessOdd, bytes32 _secret)", the "nonce" here is just a random number. The "_guessOdd"
- 3. After some round are created, other players can join that room, and full fill one of the left bets positions with their guess and secret settings.
- 4. After all the bet positions are full filled by the players, then the process of secret revealing begins. Every player of bets in this round are required to reveal their bets. The bet secrets(nonce, guess, secret) are actually stored in user's end browser. so they just click the reveal to send transactions.
- 5. After all the bet are revealed (in revealed status), then any player or any one can trigger to finalize the round to see the result to check whether they win or not. But if the bet are not revealed and the block of (_maxRevealBlockCount) arrived, any one can trigger to cancel this round, players who revealed their bets will get refunded, but those who didn't will lose their funds.
- 6. The round ends.
- 7. Beta version, on your risk.
Let's enjoy this game, and Happy new year, there wil be more developers and games coming on the way.返回