Hosting Guide
How to put your game on the internet so anyone can play it.
Why Static Hosting?
Both games are 100% client-side — HTML, CSS, and JavaScript files that run in the browser. No server-side code. No database. No API keys. This means you can host them on any static hosting service for free.
Folder Structure for Deployment
Your project folder should look like this before deploying:
your-game/
index.html ← Entry point (must be named index.html)
style.css ← Stylesheet
main.js ← Main game script
game/
state.js ← Game state management
loop.js ← Core loop logic
Hosting Options
Option 1: GitHub Pages (Recommended)
- Create a GitHub account (if you don't have one)
- Create a new repository
- Upload all your game files
- Go to Settings → Pages
- Set source to "main" branch, root folder
- Your game will be live at
username.github.io/repo-name
Option 2: Cloudflare Pages
- Create a Cloudflare account
- Go to Pages → Create a project
- Connect your GitHub repo or upload files directly
- No build settings needed (static files)
- Your game gets a free .pages.dev domain
Option 3: Netlify (Drag & Drop)
- Go to netlify.com
- Drag your project folder onto the deploy area
- Done — you get a free .netlify.app URL
- Simplest option, no account required for first deploy
Common Hosting Errors
Usually means file paths are wrong. Check that your HTML links to CSS and JS with relative paths (e.g., ./style.css not /Users/yourname/game/style.css).
Check the browser console (F12 → Console). Look for 404 errors. Make sure file names match exactly (case-sensitive on most hosts).
Make sure the Three.js CDN script tag is in your HTML. Check that the CDN URL is using https:// (some hosts require it).
LocalStorage works on all hosted sites. It does NOT work when opening files directly with file:// protocol in some browsers. Always test on the live URL.
Pre-Launch Testing Checklist
- Open the live URL in a fresh browser (or incognito window)
- 3D scene loads and renders correctly
- Player movement works (WASD)
- Zone detection triggers correctly
- Core loop plays through one full cycle
- LocalStorage saves and loads on refresh
- No errors in browser console
- HUD displays and updates
- Signature feature triggers
- Game works on at least 2 different browsers (Chrome + Safari or Firefox)