Skip to content

this repo houses the frontend code for the encode lightlink hackathons

Notifications You must be signed in to change notification settings

Havorahq/wordana

Repository files navigation

Wordana - Web Application Game

Link to Wordana Game: (https://wordana.vercel.app)

Video presentation Link: (https://youtu.be/3-yLP3fqsc8)

Overview

Wordana is a wordle game that is built on the Lightlink blockchain network. The game makes use of the API 3 Quantum Random Number Generator protocol to whip up a collection of random words. Players then take their shot at guessing these words within a specified number of attempts. The best part? Thanks to Lightlink's gasless technology seamlessly integrated into Wordana, you get to experience all the wordle fun without the hassle of gas fees.

The Problem

Many gamers and game developers avoid blockchain-based games due to high gas fees. You cannot really blame them. Paying real money for each gaming transaction is a real buzzkill.

Visualisation of the Solution

Imagine having endless gaming sessions, maybe even sharing the fun with friends from afar. What if you could compete with friends across the miles, all on the blockchain, and guess what? No need to worry about those pesky gas fees. That's where Wordana comes in, seamlessly integrating Lightlink's gasless technology to make all this gaming magic a reality.

The Strategy

We leveraged the Enterprise Mode of the Lightlink blockchain technology and the API 3 QRNG to create an addictive wordle game called Wordana.

Technologies Used

  • Next.js: A React framework for building web applications.
  • Tailwind CSS: A utility-first CSS framework.
  • BigNumber.js: Handles large blockchain-related numbers with ease and precision.
  • rainbow-me/rainbowkit: Simplifies integration with popular wallets like MetaMask, Rainbow, and WalletConnect.
  • wagmi: Offers a clean and abstracted API for interacting with smart contracts.
  • ethers.js: Used for specific low-level interactions with the Ethereum blockchain.
  • API3 QRNG: Random number generator that provides dapps with truly random numbers based on quantum mechanics.
  • lightlink: Gasless blockchain network for enterprises and dapps.

Installation and Setup

Prerequisites

Steps

  1. Clone the repository:

    git clone https://github.com/example/wordana.git
  2. Install dependencies:

    npm install
  3. Start development server:

    npm run dev

Deployment

The application can be deployed to Vercel or Netlify using their respective deployment commands. Refer to their documentation for specific instructions.

Contributing

We welcome contributions! Please ensure your code adheres to our style guide and submit pull requests for review.

Game Flow

Home Page

Connect your wallet

  • Start by connecting your wallet; Wordana plays nice with all crypto wallets.
Screenshot 2024-02-02 at 8 57 01 PM

Click on "Start Playing"

  • After linking your wallet, just give the "start playing" button a tap, and you're off to the game menu. From there, simply choose your play mode – for now, let's go with Single Player.

Home Page

Single Player Mode

Game Mode

  • Now, you've got choices. You can either dive into a new game to earn some WRD tokens or test the waters by playing the word of the day to get the hang of things. It's all up to you. Let’s start a new game.

Single Player Mode

  • Here's the rules of the game and how it works. Always handy for first time players. All you need to do at this point is to initialise the game.
  • Hints provided: Green tile (correct letter and place), Yellow tile (correct letter but wrong place), White tile (incorrect letter).

Game Hints

  • Once you approve the transaction, the game is all yours. Take your shot at guessing the word in 5 tries and claim your WRD token reward when you win.
game_interface

Game Play

game_play
  • This is how it looks like when you guess the word correctly.
Screenshot 2024-02-01 at 10 18 08 PM
  • This is how it looks like when you win. You can claim your reward afterward
you_won
  • This is how it looks like when you lose. You can replay but you get to predict another random word provided by the API 3 QNRG
you_lost

Multiplayer Mode

  • The multiplayer works just like the single-player mode. The difference is that you get to share the fun with someone else.
  • Start by topping up your staking balance. This is simply increasing your spending cap.

- Invite player

Screenshot 2024-02-02 at 8 51 41 PM

Input the wallet of your chosen player and the amount you wish to stake

Multiplayer Mode - Invite

Join game

Screenshot 2024-02-02 at 8 52 17 PM

Input your opponent's wallet Address

Multiplayer Mode - Join Game

  • Both players start the game together.
  • Once the other player accepts your invite, it's game on, and the ultimate winner grabs it all.

Multiplayer Mode - Game Play

Player Wait

opp_wait

The first to guess the right word wins the staked token.

multi_win

If no one guesses the right word, there is no winner.

Results from scanning the main smart contract and token smart contract

image

License

This project is licensed under the MIT License.

About

this repo houses the frontend code for the encode lightlink hackathons

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published