Skip to content

21w42/secret-cards

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

Secret Rock, Paper and Scissors Cards (or just SecretCards)

This is a rock, paper & scissors minigame, but with cards! And it relies on Secret's randomness (which is explained here) to sort the cards.

Rock, paper & scissors to the next level

SecretCards is different than average rock, paper & scissors. It requires some strategy, because you can run out of rocks, papers or scissors or just be struck with bad luck and get a horrible set of cards, but is still fun! SecretCards allows you to play with someone in a room for five rounds. No bots, just you and somebody else.

image

How to play

First of all, check if you're at the testnet pulsar-3. If you're not, then connect your KEPLR wallet (which you can do using this link) and get some testnet funds. Then, you can play the game by following these steps:

  1. Create or enter a room. A room allows only two players!
  2. Wait for the transaction to be requested and allow it.
  3. Wait for your cards to be shown. It may take a while.
  4. Play!

Target audience

Anybody who wants to play something different than a betting or NFT game at Secret. Or something different than plain, old rock, paper & scissors.

Video and live demo

Live demo is at https://secret-cards.up.railway.app/

Enjoy!

secretcards.mp4

Technical stuff

➥ Code is written in Node.js using Express, but I have used vanilla HTML + CSS + JS in the frontend.

➥ Multiplayer rooms were made with Socket.io

➥ Secret.js was used to make the connection between wallet and application. I could make it work with vanilla JS using a workaround.

➥ I did not write a contract, just used the "raffle contract" at secret1sszujacjmtfcm2yc37gvl57sy06qcs86wqrwp2.

Known issues

➥ The room may alert "You've already left this room" even when entering a room for the first time. Just refresh the page.

➥ If any other problem is spotted, please raise an issue!

Image atributions

Icons: Mangsaabguru, Freepik

About

Minigames for the Secret network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.4%
  • CSS 7.9%
  • HTML 5.7%