A blockchain-based strategy game where players manage their Khanates, battle other players, and collect historical Batyrs using Ethereum smart contracts.
- Create and manage your own Khanate
- Purchase and command troops (archers and cavalry)
- Collect powerful Batyrs through lucky boxes
- Battle other players with strategic troop combinations
- Blockchain-based ownership and transactions
- Historical Kazakh theme and characters
- Node.js (v14 or higher)
- Ganache for local blockchain development
- Clone the repository:
git clone <repository-url>
cd kazakh-khanate-game
- Install dependencies:
npm install
- Start Ganache:
- Open Ganache
- Create a new workspace
- Configure the workspace to use port 7545
- Deploy the smart contract:
npx hardhat compile
npx hardhat run scripts/deploy.js --network ganache
- Update the contract address:
- Copy the deployed contract address
- Update the
contractAddress
injs/app.js
- Add images:
- Place Batyr images in
images/batyrs/
(batyr1.png to batyr5.png) - Place troop images in
images/troops/
(archer.png, cavalry.png) - Place flag image in
images/flags/
(kazakhstan_flag.png)
- Start a local web server:
npx http-server
- Open the game:
- Navigate to
http://localhost:8080
in your browser - Start playing!
- Archers: Cost 0.01 ETH each, medium damage
- Cavalry: Cost 0.02 ETH each, high damage
- Kabanbay Batyr: Very high damage (30 cavalry equivalent)
- Kobylandy Batyr: High speed and defense (25 cavalry equivalent)
- Abylai Khan: Leadership bonus (+10% troop effectiveness)
- Raimgazy Batyr: Cavalry counter specialist
- Srym Datov: Archer specialist
- Cost: 0.1 ETH
- 10% chance to receive a Batyr
- Probability drops to 0.1% if you already own a Batyr
- Success depends on:
- Troop numbers and types
- Batyr bonuses
- Strategic combinations
├── contracts/
│ └── KazakhKhanate.sol
├── images/
│ ├── batyrs/
│ ├── troops/
│ └── flags/
├── css/
│ └── style.css
├── js/
│ └── app.js
├── index.html
└── hardhat.config.js
The game uses a Solidity smart contract for:
- Khanate management
- Troop purchases
- Lucky box mechanics
- Battle resolution
- Batyr ownership
- HTML5 for structure
- CSS3 for styling
- JavaScript for game logic and blockchain interaction
- Web3.js for Ethereum integration
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by the rich history of the Kazakh Khanate
- Built with Hardhat and Web3.js
- Uses OpenZeppelin contracts for security