Skip to content

Instantly share code, notes, and snippets.

@samme
Last active February 6, 2024 19:27
Show Gist options
  • Save samme/88a13b20b997a9b3fa75db750b4e555f to your computer and use it in GitHub Desktop.
Save samme/88a13b20b997a9b3fa75db750b4e555f to your computer and use it in GitHub Desktop.

Revisions

  1. samme revised this gist Feb 6, 2024. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions main.html
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,7 @@
    <link rel=modulepreload href="https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser.esm.js">
    <title>Phaser 3 with ES modules</title>
    <style>html, body { height: 100%; margin: 0; }</style>
    <script src="main.js" type=module></script>
    </head>
    <body>
    <script src="main.js" type="module"></script>
    </body>
    <body></body>
    </html>
  2. samme revised this gist Feb 6, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions main.html
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <link rel=modulepreload href="https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser.esm.js">
    <title>Phaser 3 with ES modules</title>
    <style>html, body { height: 100%; margin: 0; }</style>
    </head>
  3. samme revised this gist Feb 6, 2024. 2 changed files with 3 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions main.js
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    import * as Phaser from "https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser.esm.js";
    import { Game } from "https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser.esm.js";

    import { gameConfig } from "./gameConfig.js";

    new Phaser.Game(gameConfig);
    new Game(gameConfig);
    1 change: 1 addition & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    https://github.com/phaserjs/phaser/blob/master/changelog/3.60/ESMSupport.md
  4. samme created this gist Feb 4, 2024.
    7 changes: 7 additions & 0 deletions gameConfig.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    export const gameConfig = {
    scene: {
    create: function () {
    this.add.text(0, 0, "Hello world");
    }
    }
    };
    11 changes: 11 additions & 0 deletions main.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>Phaser 3 with ES modules</title>
    <style>html, body { height: 100%; margin: 0; }</style>
    </head>
    <body>
    <script src="main.js" type="module"></script>
    </body>
    </html>
    5 changes: 5 additions & 0 deletions main.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    import * as Phaser from "https://cdn.jsdelivr.net/npm/[email protected]/dist/phaser.esm.js";

    import { gameConfig } from "./gameConfig.js";

    new Phaser.Game(gameConfig);