Giter Site home page Giter Site logo

nhunter0 / nhcoinmininggame Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 77 KB

Clicker game built on a blockchain.

Home Page: https://nhunter0.github.io/NHCoinMiningGame/

JavaScript 52.09% HTML 36.39% CSS 11.52%
blockchaingame chartjs cryptogame cryptojs clickergame

nhcoinmininggame's Introduction

NHCoin Mining Game

Overview

Welcome to the NHCoin Mining Game! This project is a fun, interactive game that combines the addictive nature of clicker games with the concept of mining cryptocurrency using a simple blockchain. Players can mine NHCoin by clicking a button, sell the mined coins for gems, and purchase helpers to automate the mining process.

Try It Now! at: Play NHCoin Mining Game

Features

  • Mining NHCoin: Click the "Mine NHCoin" button to mine coins.
  • Blockchain Integration: Each mined coin is added to a blockchain, ensuring unique and verifiable transactions.
  • Coin Price Fluctuation: The price of NHCoin fluctuates randomly between 0.1 and 1.0, displayed on a graph.
  • Selling Coins: Sell mined coins for gems based on the current coin price.
  • Buying Helpers: Use gems to purchase helpers that automate the mining process.
  • Dynamic UI: The game interface updates in real-time, including animations and price arrows to indicate coin value changes.

Technologies Used

  • HTML5 & CSS3: For structuring and styling the web application.
  • Bootstrap 4: To create a responsive and visually appealing layout.
  • JavaScript: For game logic and interactivity.
  • Chart.js: To display the coin price fluctuations in a graph.
  • Crypto-JS: For hashing and cryptographic functions to simulate a blockchain.
  • Blockchain.js & Game.js: Custom JavaScript files to handle the blockchain and game functionalities.

Getting Started

Prerequisites

  • A modern web browser (Chrome, Firefox, Edge, etc.)

Installation

  1. Clone the repository:
git clone https://github.com/nhunter0/NHCoinMiningGame.git
  1. Navigate to the project directory:
cd NHCoinMiningGame
  1. Open the index.html file in your web browser:
open index.html

How It Works

Mining NHCoin

  • Click the "Mine NHCoin" button to simulate mining.
  • Each click is counted, and once the required number of clicks is reached, a new coin is mined.
  • The mined coin is added to the blockchain, which records the transaction details, proof of work, and previous hash.

Blockchain Integration

  • Each mined coin is recorded as a new block in the blockchain.
  • The blockchain ensures the integrity and uniqueness of each mined coin.
  • The blockchain implementation uses proof of work to simulate real mining processes.

Coin Price Fluctuation

  • The coin price fluctuates between 0.1 and 1.0.
  • The price is updated every 2 seconds and is displayed on a graph using Chart.js.
  • Arrows indicate whether the price has increased (green arrow) or decreased (red arrow).

Selling Coins

  • Players can sell their mined coins for gems by clicking the "Sell All Coins" button.
  • The gem amount received is based on the current coin price.
  • Sold coins are removed from the blockchain.

Buying Helpers

  • Gems can be used to buy helpers, which automate the mining process.
  • Each helper mines one coin per second.
  • The number of helpers and their cost in gems is displayed in the shop.

Code Structure

  • index.html: The main HTML file containing the structure of the game interface.
  • styles.css: The CSS file for styling the game interface.
  • blockchain.js: Contains the blockchain implementation and related functions.
  • game.js: Contains the game logic and functions for mining, selling, and buying helpers.

Screenshots

Game Interface

Acknowledgments

  • Inspired by classic clicker games and the concept of blockchain technology.

Feel free to fork this project, contribute, or customize it further. Happy mining!

nhcoinmininggame's People

Contributors

nhunter0 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

sudorootec

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.