Code Monkey home page Code Monkey logo

dapp_tic-tac-toe's Introduction

DApp Tic-Tac-Toe

Simple demonstration of a decentralized game using Node.JS, Truffle, and Solidity. This is the classic strategy game that's easy to learn, but tough to win (https://en.wikipedia.org/wiki/Tic-tac-toe, hopefully you shouldn't need to look at the Wikipedia article for this one). This demo also includes options for bidding on games and placing aribitrary amounts of ETH.

Live demo

  • Use MetaMask connection to either the Ropsten testnet,
  • Open the Live Demo (http://34.197.89.246:2200/). In the event that the link does not work, you can follow the instructions below and run your own version of the demo locally.

This is a DApp version of the game

Gameplay

  1. Once the User
  2. Player 1 marks cells with crosses, player 2 marks with circles
  3. Players move one at a time and cannot place their marks in the same cells at the same time
  4. If one Player places 3 marks of theirs in a row, either vertically, horizontally, or diagonally, they are declared the Winner
  5. Winner gets bid placed by the loser
  6. Players then have option to create another new game or join an existing one

Screenshot

Pre-installation Dependencies

BONUS FOR EXPERIMENTAL FEATURES

Installing the DApp

  1. Clone repo with the following command into your directory of choice, git clone https://github.com/matthew-mcateer/decentralized_game_demo.git
  2. Install MetaMask for your browser, and set up your user account
  3. Run npm install
  4. Start rpc or ganache. (Change the network address accordingly in truffle.js)
  5. Compile and migrate contract truffle compile && truffle migrate
  6. Run npm run dev
  7. Open browser to localhost:8545 if previous command didn't automatically work

Completed

  • Stylish Front-end design for game created
  • Main responsive javascript app, app.js, created for running the game
  • Solidity contract created containing logic and rules of the game
  • Added contract execution capabilities within HTML for page
  • Game successfully tested on local testnet
  • Dependency Tracking set up with yarn

Next Steps

  • Refine Front-end additionally using Angular and/or React
  • Either Creating more permenant web app or further decentralization of back-end
  • Add Whisper Chat functionality based on this.
  • Add IPFS Functionality based on this. Some local files for the game were uploaded to the IPFS successfully, but a dedicated IPFS daemon needs to be created and maintain, or the hashed become invalid within 24-hours.
  • Reimplement contracts using the experimental Vyper Programming Language. This has been partially successful, but further testing and debugging is required
  • Increasing room for additional game rooms
  • Containerization using Docker

Known Issues

errr error in MetaMask Unknown, Ethereum test network is possibly overloaded

Unhandled rejection Error: Couldn't decode bool from ABI: 0x Contract likely wasn't deployed correctly

Submitting additional Issues

Additional new issued can be submitted to the issues page for this repo.

3rd-Party Resources & Special Thanks

This project was made possible by the existence of multiple resources for Ethereum Game Development, which served as eithr direct tutorials or indirect guides. Some of the resources that were looked at over the course of this project include but were not limited to.

The Resources of The School of AI and Siraj Raval

Useful Documentation and Articles

3rd Party JavaScript Tic Tac Toe Games

https://github.com/richleland/Tic-Tac-Toe https://github.com/rolling-scopes-school/tic-tac-toe https://github.com/jwngr/tic-tac-tic-tac-toe https://github.com/sf-wdi-gaia/tic-tac-toe

3rd Party Solidity Ethereum DApps & Smart Contracts

3rd Party IPFS Game Examples

dapp_tic-tac-toe's People

Contributors

matthew-mcateer avatar

Watchers

 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.