Last active
February 6, 2024 19:27
-
-
Save samme/c1006080b0cc37c7a563452c61fa6ca3 to your computer and use it in GitHub Desktop.
Phaser 3 global with ES modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const gameConfig = { | |
scene: { | |
create: function () { | |
this.add.text(0, 0, "Hello world"); | |
} | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Phaser 3 game</title> | |
<style>html, body { height: 100%; margin: 0; }</style> | |
<script src="https://cdn.jsdelivr.net/npm/phaser@3.70.0/dist/phaser.js" defer></script> | |
<script src="main.js" type=module></script> | |
</head> | |
<body></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { gameConfig } from "./gameConfig.js"; | |
new Phaser.Game(gameConfig); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment