Note: After entering the wallet address, you have to hit ENTER so that the proceed button can be seen in the UI. Your public wallet address is used in the initial field to start the game.

Inspiration

Whenever one thinks of a game that has to be integrated with blockchain technology, people often limit their thinking and always come up with games that will be somehow related to NFTs. We have stopped thinking of Web3 games beyond that. And with this project, I want to tell the world that there are many other ways, in which we can integrate Web3 into games. With these thoughts, let me present you with my gamified solution: Learnera (Linera meets learning)

What it does

It is a 2D RPG (Role Playing Game), in which there is a player and through that player, the player will interact with the game. the player can be navigated using the four arrow keys. The Linera GraphQL server running in the backend, serves as the platform that provides different utility functions to the game. Flip the buckets, and Maze Runner are the games that can be played. In Flip the buckets game, we have to make a correct triplet of cards (one image card and 2 being text cards). The cards are related to different fields, like Linera Blockchain, OS, DBMS, and even Data Structures. So, it enriches the knowledge bank of the user while playing a game.

In the other game, we have to find our way to the next maze and complete all of the levels before the timer hits zero. If we ever run of time, then we would be deployed at the start of the recently passed level and had to start from there.

How I built it

The idea of making a pure JS-based game was difficult as I had to work around the DOM manually and do a lot of manipulations to make the game live. After making the front end, I had to integrate the same into the linera server so that the two could be linked. So, the linera contract provides the following features:

  1. A ping function (frontend pings this server after every 1 second, and it simply returns a print statement such that the frontend could be rest assured of the fact that the server is listening to the requests)

  2. Wallet check function: After entering the wallet address, this function checks whether this wallet is present in one of the chains

  3. User details updation function: Each user has some details like (score, last login, purchased songs, and username). All of them would be stored and updated time and again with the help of this function.

  4. Handling the transactions: When the user purchases a song/requests a hint, user'sw wallet would be deducted with a certain amount of tokens to get the services.

Challenges I ran into

It was nothing short of a hilarious and adventurous journey for me. From not knowing anything about Rust/blockchain to making a final project, I am very proud of my journey and grateful that I created such a great project.

What I learned

How to create a game and think about the logical things in there. Everything about Rust and Linera from scratch.

What's next for Learnera

  1. The minted NFTs (https://versatilevats.com/linera/nft.html), will be provided to the weekly high scorers automatically with the help of a CRON job.

  2. For each spend, a transaction log will be created and the user can see the same from the UI itself.

  3. Auction feature can be introduced so that the users bid for a weekly NFT.

Built With

Share this project:

Updates