A real-time multiplayer arena shooter with Web3 integration on Base chain. Compete in free matches or stake ETH for winner-takes-all battles. Clone it and try it yourself
- Move: WASD keys
- Shoot: Click to fire projectiles (200ms cooldown)
- Health: 3 HP per life, 3 lives total
- Respawn: Automatic respawn with 2s invincibility
- Objective: Eliminate other players, climb the leaderboard
- Real-time multiplayer with Socket.IO
- Smooth player interpolation
- Live leaderboard
- Neon-glow visual effects
- Health bars and lives system
- Kill feed notifications
- Procedural sound effects (Web Audio API)
- Screen shake on hit
- Free Play: Play without wallet, stats recorded on-chain
- Staked Matches: Stake ETH, winner takes 97.5% of the pot
- On-chain Leaderboard: Persistent stats across sessions
- Achievements: Unlock NFT-style achievements
- ARENA Token: Earn tokens for kills and wins
- Node.js 18+
- MetaMask wallet (for Web3 features)
- Base Sepolia ETH (for staked matches)
# Clone the repository
git clone https://github.com/YOUR_USERNAME/neonstrike.git
cd neonstrike
# Install dependencies
npm install
# Copy environment file
cp .env.example .env
# Start the server
npm startOpen http://localhost:3000 in your browser.
# Server
PORT=3000
# Blockchain (Base Sepolia)
CHAIN_ID=84532
SERVER_PRIVATE_KEY=your_private_key
# Contract Addresses
GAME_MANAGER_ADDRESS=0x...
LEADERBOARD_ADDRESS=0x...
GAME_TOKEN_ADDRESS=0x...Deployed on Base Sepolia:
| Contract | Address |
|---|---|
| GameManager | 0xC07DbdcC57C3420d6B21031F7E00DCE1a627E859 |
| LeaderboardRegistry | 0x55b4D19Df4BD408eAcCb546e92207DC7F88Ca0EC |
| GameToken | 0xb9056Fff904D6Fb7BcD6e944e7b480A3706B4434 |
GameManager.sol
- Create/join staked matches (0.001 - 10 ETH)
- Escrow funds during gameplay
- Server-signed result verification
- 2.5% platform fee on winnings
LeaderboardRegistry.sol
- Track kills, deaths, wins, losses
- Season-based rankings
- Achievement system (First Win, 10 Streak, etc.)
GameToken.sol (ARENA)
- ERC-20 reward token
- 1 token per kill, 10 per win
- Daily mint cap to prevent abuse
neonstrike/
├── backend.js # Express + Socket.IO server
├── public/
│ ├── index.html # Game UI with HUD
│ └── js/
│ ├── frontend.js # Game client + wallet state
│ ├── wallet.js # MetaMask integration
│ ├── gameUI.js # UI modals and controls
│ ├── sound.js # Web Audio API sound effects
│ ├── eventListeners.js
│ ├── contracts/
│ │ └── abis.js # Contract ABIs
│ └── classes/
│ ├── Player.js # Player with health bar
│ ├── Projectile.js
│ └── Particle.js
├── contracts/
│ ├── contracts/
│ │ ├── GameManager.sol
│ │ ├── LeaderboardRegistry.sol
│ │ └── GameToken.sol
│ ├── scripts/deploy.js
│ └── hardhat.config.js
└── .env
cd contracts
npm install
# Deploy to Base Sepolia testnet
npm run deploy:sepolia
# Deploy to Base Mainnet (production)
npm run deploy:mainnet- No wallet required
- Join instantly with username
- Stats recorded on-chain (if wallet connected)
- Earn ARENA tokens for performance
- Connect MetaMask wallet
- Switch to Base Sepolia network
- Create match with ETH stake (0.001 - 10 ETH)
- Share Match ID or wait for opponent
- Winner claims 97.5% of total pot
- Respawn system with lives (3 lives, auto-respawn)
- Health bars (3 HP per life)
- Shooting cooldown (200ms)
- Sound effects (Web Audio API procedural sounds)
- Kill feed notifications
- Screen shake on damage
- Invincibility on respawn (2 seconds)
- Mobile touch controls
- Death particles/animations
- Match timer display
- Power-ups (speed boost, shield, rapid fire)
- Map obstacles
- In-game chat
- Player profiles
- Friends list
- Private matches
- Spectator mode
- Security audit
- Mainnet deployment
- Tournament system
- Seasonal rewards
- DAO governance with ARENA token
- Frontend: HTML5 Canvas, Vanilla JS, GSAP
- Backend: Node.js, Express, Socket.IO
- Blockchain: Solidity, Hardhat, ethers.js
- Network: Base (Ethereum L2)
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see LICENSE for details.
Built with Base