Crypterium Wars is a Decentralized Application (Dapp) Game developed on Ethereum. It benefits from a lot of features that a blockchain offers, namely, high security, censorship resistance and a 100% ownership of the assets in the game by the player. Whereas the cost and the delay of each transaction barely affect the game and therefore, the advantages of using a blockchain outweigh the disadvantages.
Each player can create a Commander which is associated with their Ethereum address. A Commander is a non-fungible ERC-721 token that is indivisible and unique. It is also possible to transfer a Commander to another address which does not already have one. After creating a Commander, the player can harvest or buy Crypterium that can be used to produce different units. Currently, there are infantry, vehicle and aircraft units each with unique combat stats. A player can also attack other Commanders and fight for a certain amount of Crypterium. Furthermore, there are missions which require a strong force of units depending on the mission level, but the reward increases as well. For really dedicated players, there is a special mission that can only be solved with some technical knowledge, but the reward will be worth the effort.
The front-end of the game is currently just functional and can be improved with graphics and animations. For example, production animations while building units and battle animations for missions and attacks on other players. The smart contract can also be improved by adding new features or increasing the complexity of the current game logic.
In order to run the game on your local machine some requirements need to be installed.
First install npm
which is distributed with Node.js.
https://nodejs.org/en/download/
Truffle is a development environment, testing framework and asset pipeline for Ethereum, aiming to make life as an Ethereum developer easier. It can be used to compile, deploy and test smart contracts.
npm install -g truffle
Provides a local development blockchain server.
npm install -g ganache-cli
Local development HTTP server needed to interact with the front-end of the game.
npm install -g serve
MetaMask is a browser extension that allows you to interact with the Ethereum blockchain.
These are the instructions to get the game up and running on your local blockchain.
ganache-cli -m "MetaMask Seed Words"
cd mvp-dapp-game
truffle compile
truffle migrate
In order to use the front-end with your deployed contract you need to set the CrypteriumWars contract address in scripts/logic.js.
serve
Set the network in your MetaMask to Localhost 8545.
That's it. Now you can use the front-end to interact with the smart contract on your local blockchain and sign transactions with MetaMask.
Code released under the MIT License.