EXPORTING YOUR GAME
In order to port your game to the Web, you need to make sure you team's game engine is capable of doing so. The follwoing instructions are for those using Godot 4.3+. If your team is using a different engine, you can skip Step 1 and figure out how to do the Web export, then, follow Step 2 and 3.
Before you start:
Before you export, verify the following three items. Skipping them is the most common cause of a blank screen or broken game.
- If using Godot, make sure it is 4.3 or newer. From version 4.3 onward, Godot defaults to single-threaded web exports, which avoid the most common hosting headaches.
- If using Godot, your project must use GDScript, not C#. C# projects cannot currently be exported to the web.
- Make sure your game has a description and a cover image (If using Godot, add it in Project→Project Settings→Application→Boot Splash).
Step 1: Export the Game from Godot
- Open your project in Godot.
- Go to Project→Export...
- Click Add... and select
Web (if you already have a Web export template, skip). - When prompted, download and install the export templates (this is a one-time step per Godot version).
- In the export settings, leave "Thread Support" unchecked (this is the default in Godot 4.3+ and avoids header issues).
- Click Export Project...
- Choose an empty folder to export into. Name the main file
index.html -
Godot will generate several files, typically including:
index.html,index.js,index.wasm,index.pck,index.png,index.audio.worklet.js(and similar support files)
TIP: Read more details about requirements and customizations at Godot's Documentation Pages: Exporting for Web.
Step 2: Test Locally
Test that your game export works as intended. The following items can help your team test locally using Python's HTTP Server:
-
Open a terminal and navigate to the folder containing the exported
index.htmlfile.- Windows: Open the folder, right-click in the file explorer, and select "Open in Terminal" (or "Open PowerShell here").
- macOS/Linux: Open Terminal and use
cd path/to/export/folder.
- Start the server using python (whatever installation/version you have):
python3 -m http.server -
You should see a message like:
- Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
- Test in your browser by going to:
http://localhost:8000 - Your game should load. If you see a blank screen or an error, check the browser's developer console (press F12) for clues.
- When done, stop the server: press Ctrl+C (both Windows and macOS) in the terminal.
IMPORTANT NOTE: Test your game thoroughly and fix any bugs you might find.
Step 3: Host on GitHub
-
Create the repository:
- Go to GitHub and create a new repository. Name it something like
GAME-NAME-REPO. - Make it Public.
- Do not initialize with a README because you are planning to push your existing files.
- Go to GitHub and create a new repository. Name it something like
-
Upload with Git Command Line (the GitHub Web Interface has size limits, and some of your files will be huge!):
- cd path/to/export/folder git init git add . git commit -m "Initial web export" git branch -M main git remote add origin https://github.com/YOUR-USERNAME/GAME-NAME-REPO.git git push -u origin main
Finally...
Your game will be then downloaded and hosted in the class website. Once you have provided a link to the public repository of your game export, it will be cloned and made available for all to play!.