AI TOOLS

Share a Phaser game as a link

AI tools write browser games with Phaser. Load Phaser from a CDN in one HTML file, put sprites inside the file, then upload it and send a link people can play.

4 min read·

Ask Claude or ChatGPT for a small game and the code often uses Phaser. It plays in the chat preview. Saved and opened somewhere else, the same code can show a blank canvas or placeholder boxes where the sprites should be.

Phaser runs in the browser with no server, so one HTML file is enough. Load Phaser from a CDN, keep every image inside the file or on a public URL, and upload the file.

The file

Put the game code the AI tool wrote in an HTML file, with Phaser loaded first:

  • ✓<script src="https://cdn.jsdelivr.net/npm/phaser@4.2.1/dist/phaser.min.js"></script>
  • ✓Then a <script> with the scene classes and new Phaser.Game({ ... }).
  • ✓Tested in Chrome with Phaser 4.2.1: an arcade-physics sprite drawn from a generated texture moved across the canvas, with the WebGL renderer.

Placeholder boxes instead of sprites

Game code usually loads art with this.load.image('star', 'assets/star.png'). The link serves one HTML file, so there is no assets folder next to it. In our test the loader reported an error for that file and the sprite used Phaser's missing-texture placeholder instead.

Two fixes, both tested in Phaser 4.2.1. Replace the path with a data: URL of the image, as in this.load.image('star', 'data:image/png;base64,...'); the sprite loaded with its own texture. Or draw the shape in code: this.make.graphics() followed by generateTexture('box', 32, 32) makes a texture with no file at all, which is how many AI-written games already work. Images on a public URL also load.

Blank page, error "Failed to resolve module specifier"

Code written for a build tool starts with import Phaser from "phaser". A browser does not know where "phaser" lives, so the module stops on its first line with "Failed to resolve module specifier "phaser"" in the console.

Two fixes. Delete the import line and load Phaser with the script tag above; Phaser becomes a global the code can use as written. Or keep the import, change it to import * as Phaser from "phaser", and add an import map in the head: <script type="importmap">{ "imports": { "phaser": "https://esm.sh/phaser@4.2.1" } }</script>. Both were tested.

Upload it and send the link

Drag the file onto the FileShare Pro dashboard and copy the link. Viewers need no account. The page opens in View mode, so clicks and key presses go to the game.

Turn on comments and playtesters can pin notes to a spot on the page after typing a name. When you fix a bug or tune the difficulty, upload the new file over the old one; the link stays the same: updating a shared link without changing it.

Related: sharing an HTML game as a link, sharing a p5.js or three.js sketch as a link and why a page that works in chat breaks when hosted.

Frequently asked

Does this work with Phaser 3 code?

The steps are the same: a script tag from the CDN and images inside the file. The test above used Phaser 4.2.1; if the AI tool wrote Phaser 3 code that uses an API Phaser 4 changed, load phaser@3 in the script tag instead.

Can I add sound?

Sound files follow the same rule as images: a data: URL or a public URL. Browsers start audio only after the player clicks or presses a key.

Is it free?

Yes. The free plan hosts up to 50 files of up to 100 MB each, with view counts and comments included. Password-protected links are on Pro.

Got a page to share?

Drop the file, copy the link — live in seconds, free plan included.

Start sharing free