Multiplayer On-chain Horse Racing game powered by Aptos Random Roll Mint your destined APThorse powered by random acceleration, velocity & hurdles and challenge your friends and top the leaderboards
Check out our smart contracts here: https://github.com/IntoTheVerse/APTHorse-contracts
Built using
- Aptos Unity SDK (official licensed): https://github.com/aptos-labs/Aptos-Unity-SDK the sDK creates HD wallet for every user who signs up
- Move Language
- Aptos Randomness (Aptos Random Roll on-chain API)
- Unity and Photon Engine
- Hasura Graph QL indexer (to index transaction data from Aptos Randomet to the client)
The game is completely simulated on the blockchain, so that in future, the developers can port unique clients to the Aptos smart contract backend, and play their races. We only use Photon engine to set up rooms for every raceID fetched from the Aptos Network
✅ On-chain player profile creation, race creation, start race, end race and staking APT tokens to participate and withdrawal upon leaving race and race creation rooms ✅ In-game on-chain randomness, random max velocity - assigned upon mint, random acceleration and random position of puddles on racetrack assigned upon starting a race ✅ In-game marketplace to mint your random horse which determines their maximum speed ✅ On-chain gameplay - reading velocity, acceleration and puddle position data from blockchain and simulating on the racetrack on the client ✅ Prize distribution - based on leaderboard powered by randomness within a range of percentage prize pool reserved ✅ Indexing data using C# on unity using graphQL to fetch speeds, acceleration and rewards
- The randomness determines the maximum velocity for the horse, which is unique and provably fair for every mint powered by Aptos on-chain randomness
- Players join the rooms inside the unity game, and the races are created - deposit 10 APT for 1 lap, 7 APT for 3 Laps, and 4 APT coins for 5 Lap races, they can also leave race by withdrawing their stake
- The race outcome is determined by the horses maximum velocity, and also controlled by random acceleration that is assigned by Aptos randomness at the start of every race, and also position of puddles on the race track, that is also determined by Aptos randomness
- The puddles (marshy tile pieces on the race track) set player's acceleration to 0 each time the horses encounter them on the track. Acceleration is the rate at which the horse attains its maximum velocity
- Whether, you have the fastest horse, or the slowest, the best acceleration or the least, or whether you encounter the puddle early on in the race or just before the finish track every horse (fast or slow) has an equal stake in the race
- The prize distribution for every race is also determined by the randomness on-chain, which makes sure that the tokens from the initial stake are randomly distributed according to the poisitions in the descending order and as a developer, we retain the smallest share after the random distribution
- Currently we allow rooms for 5 horses in a multiplayer jockey gaming
https://github.com/IntoTheVerse/APTHorse-contracts/blob/main/sources/horses.move
-
Has all functions related to:
-
Collection Aptos NFT standard with attributes like name, price, description, token URI, price and max speed which is determined by Aptos Roll upon mint -Getting speed of horse upon mint into the unity game engine
-
Standard minting functions on Aptos
https://github.com/IntoTheVerse/APTHorse-contracts/blob/main/sources/publisher_signer.move
Has all functions related to:
- Publisher/signer authority
https://github.com/IntoTheVerse/APTHorse-contracts/blob/main/sources/user.move
Has all functions related to:
- Creating user
- Changing username
- Getting username