Giter Club home page Giter Club logo

nfthack-secretheroes's Introduction

NFTHack-SecretHeroes

Entry for #NFTHack 2021 https://hack.ethglobal.co/showcase/secret-heros-reckb8Gx0K55ezLIA

Summary

Secret Heroes is a card game based on secretNFTs on SNIP-721 standard on Secret Network. Leveraging privacy properties of Secret Network, SNIP-721 enables private ownership and private metadata in NFTs.

Players can buy NFT cards (heroes) with four different skills. Players can “battle” their cards against 2 other players. The game randomly determines a skill to evaluate and determines a winner based on which card has the highest value for that skill. The winner receives all the cards used in the battle. No player has any information about other players’ cards at any point excpept the winning card.

Heroes

Each card is a secretNFT, minted by a secret contract

Hero Components

  • Name - Created by website; public metadata
  • Image or 3D Model - Generated by Unity, based on scores; image not stored in the NFT
  • Skill x 4 - Randomly generated by NFT minting contract - range from 1-100; private metadata
  • Rarity - Based on skill scores; cards with skill (any) score above 90

Skills

  • Weapons
  • Engineering
  • Biotech
  • Psychics

Game play

Purchasing Heroes

Overview

  • Players can purchase hero packs in exchange for SCRT. When they press a purchase button, Keplr TX is prompted, then player pays with SCRT. When purchase resolves, players are shown their purchased heroes.
  • Each pack has 3 heroes: When a player calls the minting contract (makes the payment), the minting contract calls the SNIP721 contract to mint 3 different cards.
  • For each card, the skills are calculated by a PRNG event (4 different PRNG is created for each card). The skills then set the rarity for the card.

Hero collection

  • Players can view all their heroes
  • Players can select which hero they want to use in battle
  • Players see their battle history

Battling Heroes

  • There is a battle arena where players can battle their heroes against 2 other players (3 players total in a fight)
  • When players enter a battle, they send their card into a battle contract and wait for 2 other players to join
  • When 3 players are in the battle, the contract randomly chooses 1 of the 4 skills to evaluate the battle on. This is shown in the UI, along with the players name (secret network address) and the battle begins (might be animated)
  • The card with the highest point for the chosen skill wins the battle. The winning player takes all other NFTs in the fight. i) If there is a tie, the sum of all skills determines the winner. ii) If there is a tie, the game is a tie and all cards are returned to all players
  • When the fight ends (battle_history_query): i) Player is shown the skill that’s chosen for the fight ii) If a player won, they’re shown their hero and all the heroes they won. iii) If a player lost, they’re shown the skill level of winning card for the chosen skill + the card they lost Each step in this process should have a 2-3 block delay so that there’s an excitement element

nfthack-secretheroes's People

Contributors

floar avatar baedrik avatar cankisagun avatar

Forkers

baedrik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.