Giter Site home page Giter Site logo

rps's Introduction

RPS Game: A Fun and Educational Project for Sui Developers

This repository showcases a simple Rock-Paper-Scissors game built on the Sui blockchain. It serves as a valuable learning resource for developers interested in exploring the possibilities of building within the Sui ecosystem.

If you would like the administrator to choose a winner, kindly review the tag on GitHub.

Features:

For Players:

  • Manage your friendlist: Add and connect with fellow Rock-Paper-Scissors enthusiasts.
  • Challenge the world: Issue playful duels to anyone, whether they're on your friendlist or not.
  • Whitelisted competition: Use designated tokens for secure and transparent gameplay.
  • Claim your rewards: Collect your winnings after each exciting round.

For Admins:

  • Token control: Define which tokens are eligible for game participation.
  • Game management: Pause and resume games as needed to ensure smooth play.
  • Fee adjustments: Adapt the protocol fee for optimal game economics.
  • Token minting: Generate custom tokens for specific addresses.

Getting Started:

  • Deploy the contract using the provided command.
ts-node utils/setup.ts
  • Update the package identifiers based on the deployment output.

  • Whitelist the necessary tokens ("rps" and "sui") from the admin address.

ts-node src/updateWhitelistedTokens.ts
  • Mint custom tokens to target addresses, again using the admin account.
ts-node src/mintToken.ts
  • Create a friendlist object to manage your network of game buddies.
ts-node src/createFriendList.ts
  • (Optional) Add friends if you prefer playing within your circle.
ts-node src/addFriend.ts
  • Challenge your opponents by creating an RPS game.
ts-node src/createRpsGame.ts
  • Accept challenges and play from any other address.
ts-node src/playRpsGame.ts
  • Once both players have made their moves, it is open for anyone to determine the winner. If a winner is not selected within a day, player2 can effortlessly transfer the funds.
ts-node src/selectWinner
  • The victor receives the designated prize money (unless it's a tie).

Beyond the Game:

This project not only offers a fun way to interact with the Sui blockchain, but also presents a practical learning tool for developers. By exploring the code and functionalities, you can gain valuable insights into building your own applications within the Sui ecosystem.

Thank you for your interest in this project! Feel free to explore and build upon it. Happy gaming and happy coding!

rps's People

Contributors

spo0ds avatar leon0x01 avatar

Stargazers

YepWan avatar

Watchers

 avatar  avatar

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.