The game is a decentralized 2D open-world RPG with turn-based battles. It is set in a fantasy world, allowing players to explore, fight monsters and possess NFT characters and collectibles registered to their wallet address. We have also included a trading marketplace for NFTs and a QR code generation system to easily access and purchase these NFTs.
Marketplace Fantom Mainnet Contract
The game is made using Unity. As a game engine, Unity is able to provide many of the most important built-in features that make a game work. That means things like physics, animations, 3D/2D rendering, collision detection etc. We can create different game objects and add components to provide them with functionality, and make them interact with each other. These components can be in-built components provided by Unity, or custom scripts that we write ourselves in C#.
-
- We used version 2021.3.16f1 of the Unity Engine to create the game.
- Utilized DoTween animation package for Unity.
-
- We used the Thirdweb web3 development framework to integrate web3 into our game and website.
-
- We used the powerful Next.js framework to create our website.
Before getting a local copy up, you must ensure that you have the necessary software required.
- Unity
https://unity3d.com/get-unity/download
- Node.js
https://nodejs.org/en/download/
- Clone the repo
git clone https://github.com/Yukino2002/Bokeverse.git
- Open the project
Bokemon
in Unity (Editor version is 2021.3.16f1) - Open the scene "SampleScene.unity" in
/Bokemon/Assets/Scenes/SampleScene.unity
- Open your
Build settings
, selectWebGL
as the target platform. - Open
Player settings
>Resolution and Presentation
and underWebGLTemplate
chooseThirdweb
. - Save and click
Build and Run
to test out your game in a browser.
- Navigate to the folder
contract
cd contract
- Deploy the contract using thirdweb ContractKit
npx thirdweb deploy .
- Confirm the 2 transactions on unitys dashboard
- Navigate to the folder
website
cd website
- Install the required dependencies
npm i
- Run the server
npm run dev
You can get a starting Bokemon(Walruse) from the game. If you want another Bokemon you can use the scripts
- Navigate to the folder
website
cd website
- Navigate to
src\scripts\deployThirdWebNFT.js
and in
var result = await contract.call("mint", "0xB7E99669e9eDdD2975511FBF059d01969f43D409", uri, 1);
replace 0xB7E99669e9eDdD2975511FBF059d01969f43D409
with your own contract address
- Run
createBokemon
script
npm run createBokemon
- Navigate to the folder
website
cd website
- Run
generate
script
npm run createBokemon
- QR code is generated in the
src\scripts\QRCodeResults
Folder - Scan the QR code and obtain a Shiny Girason!!!!
The links to the working demos(in case of any error, kindly reload, the game will run smoothly) and articles of the project are as follows:
- MetaMask, Coinbase or any other wallet that supports the Ethereum network.
- Some mainnet FTM to pay for gas fees.
- On start, the user sees the start menu, where they must connect a wallet to play. The wallet options are MetaMask, Coinbase Wallet, etc.
- With a connected wallet, players can explore, battle Bokemons, etc. They must first have a Bokemon linked to their wallet. Otherwise, they can't access the wild grass where Bokemons appear. A message appears, telling the player to talk to the white-haired NPC for a starter Bokemon.
- The player visits the white-haired NPC. If they lack a Bokemon and their party size is 0, they'll sign a transaction for a Bokemon NFT. The NFT is made using the player's wallet as seed and sent to the wallet. Wait briefly for transaction completion. If transaction fails or rejected, try again.
- Receive Walruse, the popular Ice-type Bokemon! Explore the wild grass and battle other Bokemons. On the battle screen, you can attack, flee, or switch Bokemons. Use the right attack for the right Bokemon as some are more effective against certain types. Use 'Z' to choose and 'X' to return.
-
After winning, experience points are earned and a write operation updates the Bokemon data. If the transaction is rejected, the Bokemon won't level up. If accepted, you'll see a message to wait for the transaction to complete.
-
If all party Bokemons are defeated, the battle ends and you'll be asked to heal them. Go to the sleeping healing tree to heal your Bokemons.
- You can purchase bokemons from the marketplace and increase your party size, and find rare bokemons!
- You can also redeem bokemons from QR codes.
You're all set to go! You can now battle other Bokemons, explore the map, and have fun! If you want more Bokemons, you can visit the Bokeverse marketplace and buy a Bokemon NFT or redeeem through external QR codes.
-
Improving the graphics and overall visual appearance of the game
-
Adding more NFT bokemons and collectibles for players to possess
-
Adding more quest lines, battles, and exploration elements to the game
-
Introducing new gameplay elements such as PvP arenas, boss battles, and more.
-
Add physical trading cards for redeeming in-game bokemons from the website. Sample design below:
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Pratik Jallan - LinkedIn - pratikjalan11@gmail.com
Asim Jawahir - LinkedIn - asimjawahir123@gmail.com