A multiplayer top-down sandbox survival game built with vanilla JavaScript and HTML5 Canvas. Features procedural world generation, base building, and naval combat using P2P networking.
Play the latest version at: https://ipfs.io/ipfs/bafybeid7ngttf3bfxdt3hm4yvmn3cnqiax4kxufel5zwj2h56hk6dn2pku/
Because this project uses ES6 Modules, you cannot simply open index.html directly. You must use a local server.
- Clone the repository:
git clone https://github.com/yourusername/pixel-warfare.git cd pixel-warfare - Start a local server:
- VS Code: Install the "Live Server" extension and click "Go Live".
- Python:
python3 -m http.server - Node:
npx http-server
- Open in Browser: Navigate to
http://localhost:8000(or the port provided).
- Infinite World: Procedurally generated terrain with biomes (Water, Sand, Grass, Mountains).
- Multiplayer: Host/Join games via P2P (using Trystero).
- Building: Gather resources and craft Walls, Towers, and Bridges.
- Naval Combat: Build boats with physics-based sailing and broadside cannons.
- Dynamic Environment: Day/Night cycles and wind systems.
| Key | Action |
|---|---|
| W A S D | Move |
| Mouse | Aim / Cursor |
| L-Click | Attack / Build |
| R-Click | Interact / Cancel Build |
| B | Toggle Build Menu |
| Q / E | Broadside Cannons (In Boat) |
/
├── index.html
├── styles.css
└── src/
├── config.js
├── main.js
├── utils.js
├── core/
│ ├── Game.js
│ ├── InputHandler.js
│ └── Network.js
├── world/
│ ├── World.js
│ └── ParticleSystem.js
├── entities/
│ ├── Entity.js
│ ├── Boat.js
│ ├── Npc.js
│ └── Projectile.js
└── systems/
├── Renderer.js
└── UIManager.js