├── .gitignore ├── LICENSE ├── README.md ├── index.html ├── log.js ├── package-lock.json ├── package.json ├── public ├── assets │ ├── bg.png │ └── logo.png ├── favicon.png └── style.css ├── screenshot.png ├── src ├── game │ ├── main.ts │ └── scenes │ │ ├── Boot.ts │ │ ├── Game.ts │ │ ├── GameOver.ts │ │ ├── MainMenu.ts │ │ └── Preloader.ts ├── main.ts └── vite-env.d.ts ├── tsconfig.json └── vite ├── config.dev.mjs └── config.prod.mjs /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | pnpm-debug.log* 8 | lerna-debug.log* 9 | 10 | node_modules 11 | dist 12 | dist-ssr 13 | *.local 14 | 15 | # Editor directories and files 16 | .vscode/* 17 | !.vscode/extensions.json 18 | .idea 19 | .DS_Store 20 | *.suo 21 | *.ntvs* 22 | *.njsproj 23 | *.sln 24 | *.sw? 25 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Phaser Studio Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Phaser Vite TypeScript Template 2 | 3 | This is a Phaser 3 project template that uses Vite for bundling. It supports hot-reloading for quick development workflow, includes TypeScript support and scripts to generate production-ready builds. 4 | 5 | **[This Template is also available as a JavaScript version.](https://github.com/phaserjs/template-vite)** 6 | 7 | ### Versions 8 | 9 | This template has been updated for: 10 | 11 | - [Phaser 3.90.0](https://github.com/phaserjs/phaser) 12 | - [Vite 6.3.1](https://github.com/vitejs/vite) 13 | - [TypeScript 5.7.2](https://github.com/microsoft/TypeScript) 14 | 15 | ![screenshot](screenshot.png) 16 | 17 | ## Requirements 18 | 19 | [Node.js](https://nodejs.org) is required to install dependencies and run scripts via `npm`. 20 | 21 | ## Available Commands 22 | 23 | | Command | Description | 24 | |---------|-------------| 25 | | `npm install` | Install project dependencies | 26 | | `npm run dev` | Launch a development web server | 27 | | `npm run build` | Create a production build in the `dist` folder | 28 | | `npm run dev-nolog` | Launch a development web server without sending anonymous data (see "About log.js" below) | 29 | | `npm run build-nolog` | Create a production build in the `dist` folder without sending anonymous data (see "About log.js" below) | 30 | 31 | ## Writing Code 32 | 33 | After cloning the repo, run `npm install` from your project directory. Then, you can start the local development server by running `npm run dev`. 34 | 35 | The local development server runs on `http://localhost:8080` by default. Please see the Vite documentation if you wish to change this, or add SSL support. 36 | 37 | Once the server is running you can edit any of the files in the `src` folder. Vite will automatically recompile your code and then reload the browser. 38 | 39 | ## Template Project Structure 40 | 41 | We have provided a default project structure to get you started. This is as follows: 42 | 43 | ## Template Project Structure 44 | 45 | We have provided a default project structure to get you started: 46 | 47 | | Path | Description | 48 | |------------------------------|------------------------------------------------------------| 49 | | `index.html` | A basic HTML page to contain the game. | 50 | | `public/assets` | Game sprites, audio, etc. Served directly at runtime. | 51 | | `public/style.css` | Global layout styles. | 52 | | `src/main.ts` | Application bootstrap. | 53 | | `src/game` | Folder containing the game code. | 54 | | `src/game/main.ts` | Game entry point: configures and starts the game. | 55 | | `src/game/scenes` | Folder with all Phaser game scenes. | 56 | 57 | 58 | ## Handling Assets 59 | 60 | Vite supports loading assets via JavaScript module `import` statements. 61 | 62 | This template provides support for both embedding assets and also loading them from a static folder. To embed an asset, you can import it at the top of the JavaScript file you are using it in: 63 | 64 | ```js 65 | import logoImg from './assets/logo.png' 66 | ``` 67 | 68 | To load static files such as audio files, videos, etc place them into the `public/assets` folder. Then you can use this path in the Loader calls within Phaser: 69 | 70 | ```js 71 | preload () 72 | { 73 | // This is an example of an imported bundled image. 74 | // Remember to import it at the top of this file 75 | this.load.image('logo', logoImg); 76 | 77 | // This is an example of loading a static image 78 | // from the public/assets folder: 79 | this.load.image('background', 'assets/bg.png'); 80 | } 81 | ``` 82 | 83 | When you issue the `npm run build` command, all static assets are automatically copied to the `dist/assets` folder. 84 | 85 | ## Deploying to Production 86 | 87 | After you run the `npm run build` command, your code will be built into a single bundle and saved to the `dist` folder, along with any other assets your project imported, or stored in the public assets folder. 88 | 89 | In order to deploy your game, you will need to upload *all* of the contents of the `dist` folder to a public facing web server. 90 | 91 | ## Customizing the Template 92 | 93 | ### Vite 94 | 95 | If you want to customize your build, such as adding plugin (i.e. for loading CSS or fonts), you can modify the `vite/config.*.mjs` file for cross-project changes, or you can modify and/or create new configuration files and target them in specific npm tasks inside of `package.json`. Please see the [Vite documentation](https://vitejs.dev/) for more information. 96 | 97 | ## About log.js 98 | 99 | If you inspect our node scripts you will see there is a file called `log.js`. This file makes a single silent API call to a domain called `gryzor.co`. This domain is owned by Phaser Studio Inc. The domain name is a homage to one of our favorite retro games. 100 | 101 | We send the following 3 pieces of data to this API: The name of the template being used (vue, react, etc). If the build was 'dev' or 'prod' and finally the version of Phaser being used. 102 | 103 | At no point is any personal data collected or sent. We don't know about your project files, device, browser or anything else. Feel free to inspect the `log.js` file to confirm this. 104 | 105 | Why do we do this? Because being open source means we have no visible metrics about which of our templates are being used. We work hard to maintain a large and diverse set of templates for Phaser developers and this is our small anonymous way to determine if that work is actually paying off, or not. In short, it helps us ensure we're building the tools for you. 106 | 107 | However, if you don't want to send any data, you can use these commands instead: 108 | 109 | Dev: 110 | 111 | ```bash 112 | npm run dev-nolog 113 | ``` 114 | 115 | Build: 116 | 117 | ```bash 118 | npm run build-nolog 119 | ``` 120 | 121 | Or, to disable the log entirely, simply delete the file `log.js` and remove the call to it in the `scripts` section of `package.json`: 122 | 123 | Before: 124 | 125 | ```json 126 | "scripts": { 127 | "dev": "node log.js dev & dev-template-script", 128 | "build": "node log.js build & build-template-script" 129 | }, 130 | ``` 131 | 132 | After: 133 | 134 | ```json 135 | "scripts": { 136 | "dev": "dev-template-script", 137 | "build": "build-template-script" 138 | }, 139 | ``` 140 | 141 | Either of these will stop `log.js` from running. If you do decide to do this, please could you at least join our Discord and tell us which template you're using! Or send us a quick email. Either will be super-helpful, thank you. 142 | 143 | ## Join the Phaser Community! 144 | 145 | We love to see what developers like you create with Phaser! It really motivates us to keep improving. So please join our community and show-off your work 😄 146 | 147 | **Visit:** The [Phaser website](https://phaser.io) and follow on [Phaser Twitter](https://twitter.com/phaser_)
148 | **Play:** Some of the amazing games [#madewithphaser](https://twitter.com/search?q=%23madewithphaser&src=typed_query&f=live)
149 | **Learn:** [API Docs](https://newdocs.phaser.io), [Support Forum](https://phaser.discourse.group/) and [StackOverflow](https://stackoverflow.com/questions/tagged/phaser-framework)
150 | **Discord:** Join us on [Discord](https://discord.gg/phaser)
151 | **Code:** 2000+ [Examples](https://labs.phaser.io)
152 | **Read:** The [Phaser World](https://phaser.io/community/newsletter) Newsletter
153 | 154 | Created by [Phaser Studio](mailto:support@phaser.io). Powered by coffee, anime, pixels and love. 155 | 156 | The Phaser logo and characters are © 2011 - 2025 Phaser Studio Inc. 157 | 158 | All rights reserved. 159 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Phaser - Template 9 | 10 | 11 | 12 |
13 |
14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /log.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const https = require('https'); 3 | 4 | const main = async () => { 5 | const args = process.argv.slice(2); 6 | const packageData = JSON.parse(fs.readFileSync('./package.json', 'utf8')); 7 | const event = args[0] || 'unknown'; 8 | const phaserVersion = packageData.dependencies.phaser; 9 | 10 | const options = { 11 | hostname: 'gryzor.co', 12 | port: 443, 13 | path: `/v/${event}/${phaserVersion}/${packageData.name}`, 14 | method: 'GET' 15 | }; 16 | 17 | try { 18 | const req = https.request(options, (res) => { 19 | res.on('data', () => {}); 20 | res.on('end', () => { 21 | process.exit(0); 22 | }); 23 | }); 24 | 25 | req.on('error', (error) => { 26 | process.exit(1); 27 | }); 28 | 29 | req.end(); 30 | } catch (error) { 31 | // Silence is the canvas where the soul paints its most profound thoughts. 32 | process.exit(1); 33 | } 34 | } 35 | 36 | main(); 37 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "template-vite-ts", 3 | "version": "1.3.2", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "template-vite-ts", 9 | "version": "1.3.2", 10 | "license": "MIT", 11 | "dependencies": { 12 | "phaser": "^3.88.2", 13 | "terser": "^5.39.0" 14 | }, 15 | "devDependencies": { 16 | "typescript": "~5.7.2", 17 | "vite": "^6.3.1" 18 | } 19 | }, 20 | "node_modules/@esbuild/aix-ppc64": { 21 | "version": "0.25.2", 22 | "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.2.tgz", 23 | "integrity": "sha512-wCIboOL2yXZym2cgm6mlA742s9QeJ8DjGVaL39dLN4rRwrOgOyYSnOaFPhKZGLb2ngj4EyfAFjsNJwPXZvseag==", 24 | "cpu": [ 25 | "ppc64" 26 | ], 27 | "dev": true, 28 | "license": "MIT", 29 | "optional": true, 30 | "os": [ 31 | "aix" 32 | ], 33 | "engines": { 34 | "node": ">=18" 35 | } 36 | }, 37 | "node_modules/@esbuild/android-arm": { 38 | "version": "0.25.2", 39 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.2.tgz", 40 | "integrity": "sha512-NQhH7jFstVY5x8CKbcfa166GoV0EFkaPkCKBQkdPJFvo5u+nGXLEH/ooniLb3QI8Fk58YAx7nsPLozUWfCBOJA==", 41 | "cpu": [ 42 | "arm" 43 | ], 44 | "dev": true, 45 | "license": "MIT", 46 | "optional": true, 47 | "os": [ 48 | "android" 49 | ], 50 | "engines": { 51 | "node": ">=18" 52 | } 53 | }, 54 | "node_modules/@esbuild/android-arm64": { 55 | "version": "0.25.2", 56 | "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.2.tgz", 57 | "integrity": "sha512-5ZAX5xOmTligeBaeNEPnPaeEuah53Id2tX4c2CVP3JaROTH+j4fnfHCkr1PjXMd78hMst+TlkfKcW/DlTq0i4w==", 58 | "cpu": [ 59 | "arm64" 60 | ], 61 | "dev": true, 62 | "license": "MIT", 63 | "optional": true, 64 | "os": [ 65 | "android" 66 | ], 67 | "engines": { 68 | "node": ">=18" 69 | } 70 | }, 71 | "node_modules/@esbuild/android-x64": { 72 | "version": "0.25.2", 73 | "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.2.tgz", 74 | "integrity": "sha512-Ffcx+nnma8Sge4jzddPHCZVRvIfQ0kMsUsCMcJRHkGJ1cDmhe4SsrYIjLUKn1xpHZybmOqCWwB0zQvsjdEHtkg==", 75 | "cpu": [ 76 | "x64" 77 | ], 78 | "dev": true, 79 | "license": "MIT", 80 | "optional": true, 81 | "os": [ 82 | "android" 83 | ], 84 | "engines": { 85 | "node": ">=18" 86 | } 87 | }, 88 | "node_modules/@esbuild/darwin-arm64": { 89 | "version": "0.25.2", 90 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.2.tgz", 91 | "integrity": "sha512-MpM6LUVTXAzOvN4KbjzU/q5smzryuoNjlriAIx+06RpecwCkL9JpenNzpKd2YMzLJFOdPqBpuub6eVRP5IgiSA==", 92 | "cpu": [ 93 | "arm64" 94 | ], 95 | "dev": true, 96 | "license": "MIT", 97 | "optional": true, 98 | "os": [ 99 | "darwin" 100 | ], 101 | "engines": { 102 | "node": ">=18" 103 | } 104 | }, 105 | "node_modules/@esbuild/darwin-x64": { 106 | "version": "0.25.2", 107 | "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.2.tgz", 108 | "integrity": "sha512-5eRPrTX7wFyuWe8FqEFPG2cU0+butQQVNcT4sVipqjLYQjjh8a8+vUTfgBKM88ObB85ahsnTwF7PSIt6PG+QkA==", 109 | "cpu": [ 110 | "x64" 111 | ], 112 | "dev": true, 113 | "license": "MIT", 114 | "optional": true, 115 | "os": [ 116 | "darwin" 117 | ], 118 | "engines": { 119 | "node": ">=18" 120 | } 121 | }, 122 | "node_modules/@esbuild/freebsd-arm64": { 123 | "version": "0.25.2", 124 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.2.tgz", 125 | "integrity": "sha512-mLwm4vXKiQ2UTSX4+ImyiPdiHjiZhIaE9QvC7sw0tZ6HoNMjYAqQpGyui5VRIi5sGd+uWq940gdCbY3VLvsO1w==", 126 | "cpu": [ 127 | "arm64" 128 | ], 129 | "dev": true, 130 | "license": "MIT", 131 | "optional": true, 132 | "os": [ 133 | "freebsd" 134 | ], 135 | "engines": { 136 | "node": ">=18" 137 | } 138 | }, 139 | "node_modules/@esbuild/freebsd-x64": { 140 | "version": "0.25.2", 141 | "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.2.tgz", 142 | "integrity": "sha512-6qyyn6TjayJSwGpm8J9QYYGQcRgc90nmfdUb0O7pp1s4lTY+9D0H9O02v5JqGApUyiHOtkz6+1hZNvNtEhbwRQ==", 143 | "cpu": [ 144 | "x64" 145 | ], 146 | "dev": true, 147 | "license": "MIT", 148 | "optional": true, 149 | "os": [ 150 | "freebsd" 151 | ], 152 | "engines": { 153 | "node": ">=18" 154 | } 155 | }, 156 | "node_modules/@esbuild/linux-arm": { 157 | "version": "0.25.2", 158 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.2.tgz", 159 | "integrity": "sha512-UHBRgJcmjJv5oeQF8EpTRZs/1knq6loLxTsjc3nxO9eXAPDLcWW55flrMVc97qFPbmZP31ta1AZVUKQzKTzb0g==", 160 | "cpu": [ 161 | "arm" 162 | ], 163 | "dev": true, 164 | "license": "MIT", 165 | "optional": true, 166 | "os": [ 167 | "linux" 168 | ], 169 | "engines": { 170 | "node": ">=18" 171 | } 172 | }, 173 | "node_modules/@esbuild/linux-arm64": { 174 | "version": "0.25.2", 175 | "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.2.tgz", 176 | "integrity": "sha512-gq/sjLsOyMT19I8obBISvhoYiZIAaGF8JpeXu1u8yPv8BE5HlWYobmlsfijFIZ9hIVGYkbdFhEqC0NvM4kNO0g==", 177 | "cpu": [ 178 | "arm64" 179 | ], 180 | "dev": true, 181 | "license": "MIT", 182 | "optional": true, 183 | "os": [ 184 | "linux" 185 | ], 186 | "engines": { 187 | "node": ">=18" 188 | } 189 | }, 190 | "node_modules/@esbuild/linux-ia32": { 191 | "version": "0.25.2", 192 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.2.tgz", 193 | "integrity": "sha512-bBYCv9obgW2cBP+2ZWfjYTU+f5cxRoGGQ5SeDbYdFCAZpYWrfjjfYwvUpP8MlKbP0nwZ5gyOU/0aUzZ5HWPuvQ==", 194 | "cpu": [ 195 | "ia32" 196 | ], 197 | "dev": true, 198 | "license": "MIT", 199 | "optional": true, 200 | "os": [ 201 | "linux" 202 | ], 203 | "engines": { 204 | "node": ">=18" 205 | } 206 | }, 207 | "node_modules/@esbuild/linux-loong64": { 208 | "version": "0.25.2", 209 | "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.2.tgz", 210 | "integrity": "sha512-SHNGiKtvnU2dBlM5D8CXRFdd+6etgZ9dXfaPCeJtz+37PIUlixvlIhI23L5khKXs3DIzAn9V8v+qb1TRKrgT5w==", 211 | "cpu": [ 212 | "loong64" 213 | ], 214 | "dev": true, 215 | "license": "MIT", 216 | "optional": true, 217 | "os": [ 218 | "linux" 219 | ], 220 | "engines": { 221 | "node": ">=18" 222 | } 223 | }, 224 | "node_modules/@esbuild/linux-mips64el": { 225 | "version": "0.25.2", 226 | "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.2.tgz", 227 | "integrity": "sha512-hDDRlzE6rPeoj+5fsADqdUZl1OzqDYow4TB4Y/3PlKBD0ph1e6uPHzIQcv2Z65u2K0kpeByIyAjCmjn1hJgG0Q==", 228 | "cpu": [ 229 | "mips64el" 230 | ], 231 | "dev": true, 232 | "license": "MIT", 233 | "optional": true, 234 | "os": [ 235 | "linux" 236 | ], 237 | "engines": { 238 | "node": ">=18" 239 | } 240 | }, 241 | "node_modules/@esbuild/linux-ppc64": { 242 | "version": "0.25.2", 243 | "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.2.tgz", 244 | "integrity": "sha512-tsHu2RRSWzipmUi9UBDEzc0nLc4HtpZEI5Ba+Omms5456x5WaNuiG3u7xh5AO6sipnJ9r4cRWQB2tUjPyIkc6g==", 245 | "cpu": [ 246 | "ppc64" 247 | ], 248 | "dev": true, 249 | "license": "MIT", 250 | "optional": true, 251 | "os": [ 252 | "linux" 253 | ], 254 | "engines": { 255 | "node": ">=18" 256 | } 257 | }, 258 | "node_modules/@esbuild/linux-riscv64": { 259 | "version": "0.25.2", 260 | "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.2.tgz", 261 | "integrity": "sha512-k4LtpgV7NJQOml/10uPU0s4SAXGnowi5qBSjaLWMojNCUICNu7TshqHLAEbkBdAszL5TabfvQ48kK84hyFzjnw==", 262 | "cpu": [ 263 | "riscv64" 264 | ], 265 | "dev": true, 266 | "license": "MIT", 267 | "optional": true, 268 | "os": [ 269 | "linux" 270 | ], 271 | "engines": { 272 | "node": ">=18" 273 | } 274 | }, 275 | "node_modules/@esbuild/linux-s390x": { 276 | "version": "0.25.2", 277 | "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.2.tgz", 278 | "integrity": "sha512-GRa4IshOdvKY7M/rDpRR3gkiTNp34M0eLTaC1a08gNrh4u488aPhuZOCpkF6+2wl3zAN7L7XIpOFBhnaE3/Q8Q==", 279 | "cpu": [ 280 | "s390x" 281 | ], 282 | "dev": true, 283 | "license": "MIT", 284 | "optional": true, 285 | "os": [ 286 | "linux" 287 | ], 288 | "engines": { 289 | "node": ">=18" 290 | } 291 | }, 292 | "node_modules/@esbuild/linux-x64": { 293 | "version": "0.25.2", 294 | "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.2.tgz", 295 | "integrity": "sha512-QInHERlqpTTZ4FRB0fROQWXcYRD64lAoiegezDunLpalZMjcUcld3YzZmVJ2H/Cp0wJRZ8Xtjtj0cEHhYc/uUg==", 296 | "cpu": [ 297 | "x64" 298 | ], 299 | "dev": true, 300 | "license": "MIT", 301 | "optional": true, 302 | "os": [ 303 | "linux" 304 | ], 305 | "engines": { 306 | "node": ">=18" 307 | } 308 | }, 309 | "node_modules/@esbuild/netbsd-arm64": { 310 | "version": "0.25.2", 311 | "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.2.tgz", 312 | "integrity": "sha512-talAIBoY5M8vHc6EeI2WW9d/CkiO9MQJ0IOWX8hrLhxGbro/vBXJvaQXefW2cP0z0nQVTdQ/eNyGFV1GSKrxfw==", 313 | "cpu": [ 314 | "arm64" 315 | ], 316 | "dev": true, 317 | "license": "MIT", 318 | "optional": true, 319 | "os": [ 320 | "netbsd" 321 | ], 322 | "engines": { 323 | "node": ">=18" 324 | } 325 | }, 326 | "node_modules/@esbuild/netbsd-x64": { 327 | "version": "0.25.2", 328 | "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.2.tgz", 329 | "integrity": "sha512-voZT9Z+tpOxrvfKFyfDYPc4DO4rk06qamv1a/fkuzHpiVBMOhpjK+vBmWM8J1eiB3OLSMFYNaOaBNLXGChf5tg==", 330 | "cpu": [ 331 | "x64" 332 | ], 333 | "dev": true, 334 | "license": "MIT", 335 | "optional": true, 336 | "os": [ 337 | "netbsd" 338 | ], 339 | "engines": { 340 | "node": ">=18" 341 | } 342 | }, 343 | "node_modules/@esbuild/openbsd-arm64": { 344 | "version": "0.25.2", 345 | "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.2.tgz", 346 | "integrity": "sha512-dcXYOC6NXOqcykeDlwId9kB6OkPUxOEqU+rkrYVqJbK2hagWOMrsTGsMr8+rW02M+d5Op5NNlgMmjzecaRf7Tg==", 347 | "cpu": [ 348 | "arm64" 349 | ], 350 | "dev": true, 351 | "license": "MIT", 352 | "optional": true, 353 | "os": [ 354 | "openbsd" 355 | ], 356 | "engines": { 357 | "node": ">=18" 358 | } 359 | }, 360 | "node_modules/@esbuild/openbsd-x64": { 361 | "version": "0.25.2", 362 | "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.2.tgz", 363 | "integrity": "sha512-t/TkWwahkH0Tsgoq1Ju7QfgGhArkGLkF1uYz8nQS/PPFlXbP5YgRpqQR3ARRiC2iXoLTWFxc6DJMSK10dVXluw==", 364 | "cpu": [ 365 | "x64" 366 | ], 367 | "dev": true, 368 | "license": "MIT", 369 | "optional": true, 370 | "os": [ 371 | "openbsd" 372 | ], 373 | "engines": { 374 | "node": ">=18" 375 | } 376 | }, 377 | "node_modules/@esbuild/sunos-x64": { 378 | "version": "0.25.2", 379 | "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.2.tgz", 380 | "integrity": "sha512-cfZH1co2+imVdWCjd+D1gf9NjkchVhhdpgb1q5y6Hcv9TP6Zi9ZG/beI3ig8TvwT9lH9dlxLq5MQBBgwuj4xvA==", 381 | "cpu": [ 382 | "x64" 383 | ], 384 | "dev": true, 385 | "license": "MIT", 386 | "optional": true, 387 | "os": [ 388 | "sunos" 389 | ], 390 | "engines": { 391 | "node": ">=18" 392 | } 393 | }, 394 | "node_modules/@esbuild/win32-arm64": { 395 | "version": "0.25.2", 396 | "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.2.tgz", 397 | "integrity": "sha512-7Loyjh+D/Nx/sOTzV8vfbB3GJuHdOQyrOryFdZvPHLf42Tk9ivBU5Aedi7iyX+x6rbn2Mh68T4qq1SDqJBQO5Q==", 398 | "cpu": [ 399 | "arm64" 400 | ], 401 | "dev": true, 402 | "license": "MIT", 403 | "optional": true, 404 | "os": [ 405 | "win32" 406 | ], 407 | "engines": { 408 | "node": ">=18" 409 | } 410 | }, 411 | "node_modules/@esbuild/win32-ia32": { 412 | "version": "0.25.2", 413 | "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.2.tgz", 414 | "integrity": "sha512-WRJgsz9un0nqZJ4MfhabxaD9Ft8KioqU3JMinOTvobbX6MOSUigSBlogP8QB3uxpJDsFS6yN+3FDBdqE5lg9kg==", 415 | "cpu": [ 416 | "ia32" 417 | ], 418 | "dev": true, 419 | "license": "MIT", 420 | "optional": true, 421 | "os": [ 422 | "win32" 423 | ], 424 | "engines": { 425 | "node": ">=18" 426 | } 427 | }, 428 | "node_modules/@esbuild/win32-x64": { 429 | "version": "0.25.2", 430 | "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.2.tgz", 431 | "integrity": "sha512-kM3HKb16VIXZyIeVrM1ygYmZBKybX8N4p754bw390wGO3Tf2j4L2/WYL+4suWujpgf6GBYs3jv7TyUivdd05JA==", 432 | "cpu": [ 433 | "x64" 434 | ], 435 | "dev": true, 436 | "license": "MIT", 437 | "optional": true, 438 | "os": [ 439 | "win32" 440 | ], 441 | "engines": { 442 | "node": ">=18" 443 | } 444 | }, 445 | "node_modules/@jridgewell/gen-mapping": { 446 | "version": "0.3.8", 447 | "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", 448 | "integrity": "sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==", 449 | "license": "MIT", 450 | "dependencies": { 451 | "@jridgewell/set-array": "^1.2.1", 452 | "@jridgewell/sourcemap-codec": "^1.4.10", 453 | "@jridgewell/trace-mapping": "^0.3.24" 454 | }, 455 | "engines": { 456 | "node": ">=6.0.0" 457 | } 458 | }, 459 | "node_modules/@jridgewell/resolve-uri": { 460 | "version": "3.1.2", 461 | "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", 462 | "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", 463 | "license": "MIT", 464 | "engines": { 465 | "node": ">=6.0.0" 466 | } 467 | }, 468 | "node_modules/@jridgewell/set-array": { 469 | "version": "1.2.1", 470 | "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", 471 | "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", 472 | "license": "MIT", 473 | "engines": { 474 | "node": ">=6.0.0" 475 | } 476 | }, 477 | "node_modules/@jridgewell/source-map": { 478 | "version": "0.3.6", 479 | "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", 480 | "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", 481 | "license": "MIT", 482 | "dependencies": { 483 | "@jridgewell/gen-mapping": "^0.3.5", 484 | "@jridgewell/trace-mapping": "^0.3.25" 485 | } 486 | }, 487 | "node_modules/@jridgewell/sourcemap-codec": { 488 | "version": "1.5.0", 489 | "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", 490 | "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", 491 | "license": "MIT" 492 | }, 493 | "node_modules/@jridgewell/trace-mapping": { 494 | "version": "0.3.25", 495 | "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", 496 | "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", 497 | "license": "MIT", 498 | "dependencies": { 499 | "@jridgewell/resolve-uri": "^3.1.0", 500 | "@jridgewell/sourcemap-codec": "^1.4.14" 501 | } 502 | }, 503 | "node_modules/@rollup/rollup-android-arm-eabi": { 504 | "version": "4.40.0", 505 | "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.40.0.tgz", 506 | "integrity": "sha512-+Fbls/diZ0RDerhE8kyC6hjADCXA1K4yVNlH0EYfd2XjyH0UGgzaQ8MlT0pCXAThfxv3QUAczHaL+qSv1E4/Cg==", 507 | "cpu": [ 508 | "arm" 509 | ], 510 | "dev": true, 511 | "license": "MIT", 512 | "optional": true, 513 | "os": [ 514 | "android" 515 | ] 516 | }, 517 | "node_modules/@rollup/rollup-android-arm64": { 518 | "version": "4.40.0", 519 | "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.40.0.tgz", 520 | "integrity": "sha512-PPA6aEEsTPRz+/4xxAmaoWDqh67N7wFbgFUJGMnanCFs0TV99M0M8QhhaSCks+n6EbQoFvLQgYOGXxlMGQe/6w==", 521 | "cpu": [ 522 | "arm64" 523 | ], 524 | "dev": true, 525 | "license": "MIT", 526 | "optional": true, 527 | "os": [ 528 | "android" 529 | ] 530 | }, 531 | "node_modules/@rollup/rollup-darwin-arm64": { 532 | "version": "4.40.0", 533 | "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.40.0.tgz", 534 | "integrity": "sha512-GwYOcOakYHdfnjjKwqpTGgn5a6cUX7+Ra2HeNj/GdXvO2VJOOXCiYYlRFU4CubFM67EhbmzLOmACKEfvp3J1kQ==", 535 | "cpu": [ 536 | "arm64" 537 | ], 538 | "dev": true, 539 | "license": "MIT", 540 | "optional": true, 541 | "os": [ 542 | "darwin" 543 | ] 544 | }, 545 | "node_modules/@rollup/rollup-darwin-x64": { 546 | "version": "4.40.0", 547 | "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.40.0.tgz", 548 | "integrity": "sha512-CoLEGJ+2eheqD9KBSxmma6ld01czS52Iw0e2qMZNpPDlf7Z9mj8xmMemxEucinev4LgHalDPczMyxzbq+Q+EtA==", 549 | "cpu": [ 550 | "x64" 551 | ], 552 | "dev": true, 553 | "license": "MIT", 554 | "optional": true, 555 | "os": [ 556 | "darwin" 557 | ] 558 | }, 559 | "node_modules/@rollup/rollup-freebsd-arm64": { 560 | "version": "4.40.0", 561 | "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.40.0.tgz", 562 | "integrity": "sha512-r7yGiS4HN/kibvESzmrOB/PxKMhPTlz+FcGvoUIKYoTyGd5toHp48g1uZy1o1xQvybwwpqpe010JrcGG2s5nkg==", 563 | "cpu": [ 564 | "arm64" 565 | ], 566 | "dev": true, 567 | "license": "MIT", 568 | "optional": true, 569 | "os": [ 570 | "freebsd" 571 | ] 572 | }, 573 | "node_modules/@rollup/rollup-freebsd-x64": { 574 | "version": "4.40.0", 575 | "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.40.0.tgz", 576 | "integrity": "sha512-mVDxzlf0oLzV3oZOr0SMJ0lSDd3xC4CmnWJ8Val8isp9jRGl5Dq//LLDSPFrasS7pSm6m5xAcKaw3sHXhBjoRw==", 577 | "cpu": [ 578 | "x64" 579 | ], 580 | "dev": true, 581 | "license": "MIT", 582 | "optional": true, 583 | "os": [ 584 | "freebsd" 585 | ] 586 | }, 587 | "node_modules/@rollup/rollup-linux-arm-gnueabihf": { 588 | "version": "4.40.0", 589 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.40.0.tgz", 590 | "integrity": "sha512-y/qUMOpJxBMy8xCXD++jeu8t7kzjlOCkoxxajL58G62PJGBZVl/Gwpm7JK9+YvlB701rcQTzjUZ1JgUoPTnoQA==", 591 | "cpu": [ 592 | "arm" 593 | ], 594 | "dev": true, 595 | "license": "MIT", 596 | "optional": true, 597 | "os": [ 598 | "linux" 599 | ] 600 | }, 601 | "node_modules/@rollup/rollup-linux-arm-musleabihf": { 602 | "version": "4.40.0", 603 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.40.0.tgz", 604 | "integrity": "sha512-GoCsPibtVdJFPv/BOIvBKO/XmwZLwaNWdyD8TKlXuqp0veo2sHE+A/vpMQ5iSArRUz/uaoj4h5S6Pn0+PdhRjg==", 605 | "cpu": [ 606 | "arm" 607 | ], 608 | "dev": true, 609 | "license": "MIT", 610 | "optional": true, 611 | "os": [ 612 | "linux" 613 | ] 614 | }, 615 | "node_modules/@rollup/rollup-linux-arm64-gnu": { 616 | "version": "4.40.0", 617 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.40.0.tgz", 618 | "integrity": "sha512-L5ZLphTjjAD9leJzSLI7rr8fNqJMlGDKlazW2tX4IUF9P7R5TMQPElpH82Q7eNIDQnQlAyiNVfRPfP2vM5Avvg==", 619 | "cpu": [ 620 | "arm64" 621 | ], 622 | "dev": true, 623 | "license": "MIT", 624 | "optional": true, 625 | "os": [ 626 | "linux" 627 | ] 628 | }, 629 | "node_modules/@rollup/rollup-linux-arm64-musl": { 630 | "version": "4.40.0", 631 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.40.0.tgz", 632 | "integrity": "sha512-ATZvCRGCDtv1Y4gpDIXsS+wfFeFuLwVxyUBSLawjgXK2tRE6fnsQEkE4csQQYWlBlsFztRzCnBvWVfcae/1qxQ==", 633 | "cpu": [ 634 | "arm64" 635 | ], 636 | "dev": true, 637 | "license": "MIT", 638 | "optional": true, 639 | "os": [ 640 | "linux" 641 | ] 642 | }, 643 | "node_modules/@rollup/rollup-linux-loongarch64-gnu": { 644 | "version": "4.40.0", 645 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.40.0.tgz", 646 | "integrity": "sha512-wG9e2XtIhd++QugU5MD9i7OnpaVb08ji3P1y/hNbxrQ3sYEelKJOq1UJ5dXczeo6Hj2rfDEL5GdtkMSVLa/AOg==", 647 | "cpu": [ 648 | "loong64" 649 | ], 650 | "dev": true, 651 | "license": "MIT", 652 | "optional": true, 653 | "os": [ 654 | "linux" 655 | ] 656 | }, 657 | "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { 658 | "version": "4.40.0", 659 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.40.0.tgz", 660 | "integrity": "sha512-vgXfWmj0f3jAUvC7TZSU/m/cOE558ILWDzS7jBhiCAFpY2WEBn5jqgbqvmzlMjtp8KlLcBlXVD2mkTSEQE6Ixw==", 661 | "cpu": [ 662 | "ppc64" 663 | ], 664 | "dev": true, 665 | "license": "MIT", 666 | "optional": true, 667 | "os": [ 668 | "linux" 669 | ] 670 | }, 671 | "node_modules/@rollup/rollup-linux-riscv64-gnu": { 672 | "version": "4.40.0", 673 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.40.0.tgz", 674 | "integrity": "sha512-uJkYTugqtPZBS3Z136arevt/FsKTF/J9dEMTX/cwR7lsAW4bShzI2R0pJVw+hcBTWF4dxVckYh72Hk3/hWNKvA==", 675 | "cpu": [ 676 | "riscv64" 677 | ], 678 | "dev": true, 679 | "license": "MIT", 680 | "optional": true, 681 | "os": [ 682 | "linux" 683 | ] 684 | }, 685 | "node_modules/@rollup/rollup-linux-riscv64-musl": { 686 | "version": "4.40.0", 687 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.40.0.tgz", 688 | "integrity": "sha512-rKmSj6EXQRnhSkE22+WvrqOqRtk733x3p5sWpZilhmjnkHkpeCgWsFFo0dGnUGeA+OZjRl3+VYq+HyCOEuwcxQ==", 689 | "cpu": [ 690 | "riscv64" 691 | ], 692 | "dev": true, 693 | "license": "MIT", 694 | "optional": true, 695 | "os": [ 696 | "linux" 697 | ] 698 | }, 699 | "node_modules/@rollup/rollup-linux-s390x-gnu": { 700 | "version": "4.40.0", 701 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.40.0.tgz", 702 | "integrity": "sha512-SpnYlAfKPOoVsQqmTFJ0usx0z84bzGOS9anAC0AZ3rdSo3snecihbhFTlJZ8XMwzqAcodjFU4+/SM311dqE5Sw==", 703 | "cpu": [ 704 | "s390x" 705 | ], 706 | "dev": true, 707 | "license": "MIT", 708 | "optional": true, 709 | "os": [ 710 | "linux" 711 | ] 712 | }, 713 | "node_modules/@rollup/rollup-linux-x64-gnu": { 714 | "version": "4.40.0", 715 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.0.tgz", 716 | "integrity": "sha512-RcDGMtqF9EFN8i2RYN2W+64CdHruJ5rPqrlYw+cgM3uOVPSsnAQps7cpjXe9be/yDp8UC7VLoCoKC8J3Kn2FkQ==", 717 | "cpu": [ 718 | "x64" 719 | ], 720 | "dev": true, 721 | "license": "MIT", 722 | "optional": true, 723 | "os": [ 724 | "linux" 725 | ] 726 | }, 727 | "node_modules/@rollup/rollup-linux-x64-musl": { 728 | "version": "4.40.0", 729 | "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.40.0.tgz", 730 | "integrity": "sha512-HZvjpiUmSNx5zFgwtQAV1GaGazT2RWvqeDi0hV+AtC8unqqDSsaFjPxfsO6qPtKRRg25SisACWnJ37Yio8ttaw==", 731 | "cpu": [ 732 | "x64" 733 | ], 734 | "dev": true, 735 | "license": "MIT", 736 | "optional": true, 737 | "os": [ 738 | "linux" 739 | ] 740 | }, 741 | "node_modules/@rollup/rollup-win32-arm64-msvc": { 742 | "version": "4.40.0", 743 | "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.40.0.tgz", 744 | "integrity": "sha512-UtZQQI5k/b8d7d3i9AZmA/t+Q4tk3hOC0tMOMSq2GlMYOfxbesxG4mJSeDp0EHs30N9bsfwUvs3zF4v/RzOeTQ==", 745 | "cpu": [ 746 | "arm64" 747 | ], 748 | "dev": true, 749 | "license": "MIT", 750 | "optional": true, 751 | "os": [ 752 | "win32" 753 | ] 754 | }, 755 | "node_modules/@rollup/rollup-win32-ia32-msvc": { 756 | "version": "4.40.0", 757 | "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.40.0.tgz", 758 | "integrity": "sha512-+m03kvI2f5syIqHXCZLPVYplP8pQch9JHyXKZ3AGMKlg8dCyr2PKHjwRLiW53LTrN/Nc3EqHOKxUxzoSPdKddA==", 759 | "cpu": [ 760 | "ia32" 761 | ], 762 | "dev": true, 763 | "license": "MIT", 764 | "optional": true, 765 | "os": [ 766 | "win32" 767 | ] 768 | }, 769 | "node_modules/@rollup/rollup-win32-x64-msvc": { 770 | "version": "4.40.0", 771 | "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.0.tgz", 772 | "integrity": "sha512-lpPE1cLfP5oPzVjKMx10pgBmKELQnFJXHgvtHCtuJWOv8MxqdEIMNtgHgBFf7Ea2/7EuVwa9fodWUfXAlXZLZQ==", 773 | "cpu": [ 774 | "x64" 775 | ], 776 | "dev": true, 777 | "license": "MIT", 778 | "optional": true, 779 | "os": [ 780 | "win32" 781 | ] 782 | }, 783 | "node_modules/@types/estree": { 784 | "version": "1.0.7", 785 | "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", 786 | "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", 787 | "dev": true, 788 | "license": "MIT" 789 | }, 790 | "node_modules/acorn": { 791 | "version": "8.14.1", 792 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", 793 | "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", 794 | "license": "MIT", 795 | "bin": { 796 | "acorn": "bin/acorn" 797 | }, 798 | "engines": { 799 | "node": ">=0.4.0" 800 | } 801 | }, 802 | "node_modules/buffer-from": { 803 | "version": "1.1.2", 804 | "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", 805 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", 806 | "license": "MIT" 807 | }, 808 | "node_modules/commander": { 809 | "version": "2.20.3", 810 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", 811 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", 812 | "license": "MIT" 813 | }, 814 | "node_modules/esbuild": { 815 | "version": "0.25.2", 816 | "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.2.tgz", 817 | "integrity": "sha512-16854zccKPnC+toMywC+uKNeYSv+/eXkevRAfwRD/G9Cleq66m8XFIrigkbvauLLlCfDL45Q2cWegSg53gGBnQ==", 818 | "dev": true, 819 | "hasInstallScript": true, 820 | "license": "MIT", 821 | "bin": { 822 | "esbuild": "bin/esbuild" 823 | }, 824 | "engines": { 825 | "node": ">=18" 826 | }, 827 | "optionalDependencies": { 828 | "@esbuild/aix-ppc64": "0.25.2", 829 | "@esbuild/android-arm": "0.25.2", 830 | "@esbuild/android-arm64": "0.25.2", 831 | "@esbuild/android-x64": "0.25.2", 832 | "@esbuild/darwin-arm64": "0.25.2", 833 | "@esbuild/darwin-x64": "0.25.2", 834 | "@esbuild/freebsd-arm64": "0.25.2", 835 | "@esbuild/freebsd-x64": "0.25.2", 836 | "@esbuild/linux-arm": "0.25.2", 837 | "@esbuild/linux-arm64": "0.25.2", 838 | "@esbuild/linux-ia32": "0.25.2", 839 | "@esbuild/linux-loong64": "0.25.2", 840 | "@esbuild/linux-mips64el": "0.25.2", 841 | "@esbuild/linux-ppc64": "0.25.2", 842 | "@esbuild/linux-riscv64": "0.25.2", 843 | "@esbuild/linux-s390x": "0.25.2", 844 | "@esbuild/linux-x64": "0.25.2", 845 | "@esbuild/netbsd-arm64": "0.25.2", 846 | "@esbuild/netbsd-x64": "0.25.2", 847 | "@esbuild/openbsd-arm64": "0.25.2", 848 | "@esbuild/openbsd-x64": "0.25.2", 849 | "@esbuild/sunos-x64": "0.25.2", 850 | "@esbuild/win32-arm64": "0.25.2", 851 | "@esbuild/win32-ia32": "0.25.2", 852 | "@esbuild/win32-x64": "0.25.2" 853 | } 854 | }, 855 | "node_modules/eventemitter3": { 856 | "version": "5.0.1", 857 | "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", 858 | "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", 859 | "license": "MIT" 860 | }, 861 | "node_modules/fdir": { 862 | "version": "6.4.4", 863 | "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.4.tgz", 864 | "integrity": "sha512-1NZP+GK4GfuAv3PqKvxQRDMjdSRZjnkq7KfhlNrCNNlZ0ygQFpebfrnfnq/W7fpUnAv9aGWmY1zKx7FYL3gwhg==", 865 | "dev": true, 866 | "license": "MIT", 867 | "peerDependencies": { 868 | "picomatch": "^3 || ^4" 869 | }, 870 | "peerDependenciesMeta": { 871 | "picomatch": { 872 | "optional": true 873 | } 874 | } 875 | }, 876 | "node_modules/fsevents": { 877 | "version": "2.3.3", 878 | "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", 879 | "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", 880 | "dev": true, 881 | "hasInstallScript": true, 882 | "license": "MIT", 883 | "optional": true, 884 | "os": [ 885 | "darwin" 886 | ], 887 | "engines": { 888 | "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 889 | } 890 | }, 891 | "node_modules/nanoid": { 892 | "version": "3.3.11", 893 | "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", 894 | "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", 895 | "dev": true, 896 | "funding": [ 897 | { 898 | "type": "github", 899 | "url": "https://github.com/sponsors/ai" 900 | } 901 | ], 902 | "license": "MIT", 903 | "bin": { 904 | "nanoid": "bin/nanoid.cjs" 905 | }, 906 | "engines": { 907 | "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" 908 | } 909 | }, 910 | "node_modules/phaser": { 911 | "version": "3.88.2", 912 | "resolved": "https://registry.npmjs.org/phaser/-/phaser-3.88.2.tgz", 913 | "integrity": "sha512-UBgd2sAFuRJbF2xKaQ5jpMWB8oETncChLnymLGHcrnT53vaqiGrQWbUKUDBawKLm24sghjKo4Bf+/xfv8espZQ==", 914 | "license": "MIT", 915 | "dependencies": { 916 | "eventemitter3": "^5.0.1" 917 | } 918 | }, 919 | "node_modules/picocolors": { 920 | "version": "1.1.1", 921 | "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", 922 | "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", 923 | "dev": true, 924 | "license": "ISC" 925 | }, 926 | "node_modules/picomatch": { 927 | "version": "4.0.2", 928 | "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", 929 | "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", 930 | "dev": true, 931 | "license": "MIT", 932 | "engines": { 933 | "node": ">=12" 934 | }, 935 | "funding": { 936 | "url": "https://github.com/sponsors/jonschlinkert" 937 | } 938 | }, 939 | "node_modules/postcss": { 940 | "version": "8.5.3", 941 | "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", 942 | "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", 943 | "dev": true, 944 | "funding": [ 945 | { 946 | "type": "opencollective", 947 | "url": "https://opencollective.com/postcss/" 948 | }, 949 | { 950 | "type": "tidelift", 951 | "url": "https://tidelift.com/funding/github/npm/postcss" 952 | }, 953 | { 954 | "type": "github", 955 | "url": "https://github.com/sponsors/ai" 956 | } 957 | ], 958 | "license": "MIT", 959 | "dependencies": { 960 | "nanoid": "^3.3.8", 961 | "picocolors": "^1.1.1", 962 | "source-map-js": "^1.2.1" 963 | }, 964 | "engines": { 965 | "node": "^10 || ^12 || >=14" 966 | } 967 | }, 968 | "node_modules/rollup": { 969 | "version": "4.40.0", 970 | "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.0.tgz", 971 | "integrity": "sha512-Noe455xmA96nnqH5piFtLobsGbCij7Tu+tb3c1vYjNbTkfzGqXqQXG3wJaYXkRZuQ0vEYN4bhwg7QnIrqB5B+w==", 972 | "dev": true, 973 | "license": "MIT", 974 | "dependencies": { 975 | "@types/estree": "1.0.7" 976 | }, 977 | "bin": { 978 | "rollup": "dist/bin/rollup" 979 | }, 980 | "engines": { 981 | "node": ">=18.0.0", 982 | "npm": ">=8.0.0" 983 | }, 984 | "optionalDependencies": { 985 | "@rollup/rollup-android-arm-eabi": "4.40.0", 986 | "@rollup/rollup-android-arm64": "4.40.0", 987 | "@rollup/rollup-darwin-arm64": "4.40.0", 988 | "@rollup/rollup-darwin-x64": "4.40.0", 989 | "@rollup/rollup-freebsd-arm64": "4.40.0", 990 | "@rollup/rollup-freebsd-x64": "4.40.0", 991 | "@rollup/rollup-linux-arm-gnueabihf": "4.40.0", 992 | "@rollup/rollup-linux-arm-musleabihf": "4.40.0", 993 | "@rollup/rollup-linux-arm64-gnu": "4.40.0", 994 | "@rollup/rollup-linux-arm64-musl": "4.40.0", 995 | "@rollup/rollup-linux-loongarch64-gnu": "4.40.0", 996 | "@rollup/rollup-linux-powerpc64le-gnu": "4.40.0", 997 | "@rollup/rollup-linux-riscv64-gnu": "4.40.0", 998 | "@rollup/rollup-linux-riscv64-musl": "4.40.0", 999 | "@rollup/rollup-linux-s390x-gnu": "4.40.0", 1000 | "@rollup/rollup-linux-x64-gnu": "4.40.0", 1001 | "@rollup/rollup-linux-x64-musl": "4.40.0", 1002 | "@rollup/rollup-win32-arm64-msvc": "4.40.0", 1003 | "@rollup/rollup-win32-ia32-msvc": "4.40.0", 1004 | "@rollup/rollup-win32-x64-msvc": "4.40.0", 1005 | "fsevents": "~2.3.2" 1006 | } 1007 | }, 1008 | "node_modules/source-map": { 1009 | "version": "0.6.1", 1010 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", 1011 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", 1012 | "license": "BSD-3-Clause", 1013 | "engines": { 1014 | "node": ">=0.10.0" 1015 | } 1016 | }, 1017 | "node_modules/source-map-js": { 1018 | "version": "1.2.1", 1019 | "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", 1020 | "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", 1021 | "dev": true, 1022 | "license": "BSD-3-Clause", 1023 | "engines": { 1024 | "node": ">=0.10.0" 1025 | } 1026 | }, 1027 | "node_modules/source-map-support": { 1028 | "version": "0.5.21", 1029 | "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", 1030 | "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", 1031 | "license": "MIT", 1032 | "dependencies": { 1033 | "buffer-from": "^1.0.0", 1034 | "source-map": "^0.6.0" 1035 | } 1036 | }, 1037 | "node_modules/terser": { 1038 | "version": "5.39.0", 1039 | "resolved": "https://registry.npmjs.org/terser/-/terser-5.39.0.tgz", 1040 | "integrity": "sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==", 1041 | "license": "BSD-2-Clause", 1042 | "dependencies": { 1043 | "@jridgewell/source-map": "^0.3.3", 1044 | "acorn": "^8.8.2", 1045 | "commander": "^2.20.0", 1046 | "source-map-support": "~0.5.20" 1047 | }, 1048 | "bin": { 1049 | "terser": "bin/terser" 1050 | }, 1051 | "engines": { 1052 | "node": ">=10" 1053 | } 1054 | }, 1055 | "node_modules/tinyglobby": { 1056 | "version": "0.2.13", 1057 | "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.13.tgz", 1058 | "integrity": "sha512-mEwzpUgrLySlveBwEVDMKk5B57bhLPYovRfPAXD5gA/98Opn0rCDj3GtLwFvCvH5RK9uPCExUROW5NjDwvqkxw==", 1059 | "dev": true, 1060 | "license": "MIT", 1061 | "dependencies": { 1062 | "fdir": "^6.4.4", 1063 | "picomatch": "^4.0.2" 1064 | }, 1065 | "engines": { 1066 | "node": ">=12.0.0" 1067 | }, 1068 | "funding": { 1069 | "url": "https://github.com/sponsors/SuperchupuDev" 1070 | } 1071 | }, 1072 | "node_modules/typescript": { 1073 | "version": "5.7.3", 1074 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz", 1075 | "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", 1076 | "dev": true, 1077 | "license": "Apache-2.0", 1078 | "bin": { 1079 | "tsc": "bin/tsc", 1080 | "tsserver": "bin/tsserver" 1081 | }, 1082 | "engines": { 1083 | "node": ">=14.17" 1084 | } 1085 | }, 1086 | "node_modules/vite": { 1087 | "version": "6.3.2", 1088 | "resolved": "https://registry.npmjs.org/vite/-/vite-6.3.2.tgz", 1089 | "integrity": "sha512-ZSvGOXKGceizRQIZSz7TGJ0pS3QLlVY/9hwxVh17W3re67je1RKYzFHivZ/t0tubU78Vkyb9WnHPENSBCzbckg==", 1090 | "dev": true, 1091 | "license": "MIT", 1092 | "dependencies": { 1093 | "esbuild": "^0.25.0", 1094 | "fdir": "^6.4.3", 1095 | "picomatch": "^4.0.2", 1096 | "postcss": "^8.5.3", 1097 | "rollup": "^4.34.9", 1098 | "tinyglobby": "^0.2.12" 1099 | }, 1100 | "bin": { 1101 | "vite": "bin/vite.js" 1102 | }, 1103 | "engines": { 1104 | "node": "^18.0.0 || ^20.0.0 || >=22.0.0" 1105 | }, 1106 | "funding": { 1107 | "url": "https://github.com/vitejs/vite?sponsor=1" 1108 | }, 1109 | "optionalDependencies": { 1110 | "fsevents": "~2.3.3" 1111 | }, 1112 | "peerDependencies": { 1113 | "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", 1114 | "jiti": ">=1.21.0", 1115 | "less": "*", 1116 | "lightningcss": "^1.21.0", 1117 | "sass": "*", 1118 | "sass-embedded": "*", 1119 | "stylus": "*", 1120 | "sugarss": "*", 1121 | "terser": "^5.16.0", 1122 | "tsx": "^4.8.1", 1123 | "yaml": "^2.4.2" 1124 | }, 1125 | "peerDependenciesMeta": { 1126 | "@types/node": { 1127 | "optional": true 1128 | }, 1129 | "jiti": { 1130 | "optional": true 1131 | }, 1132 | "less": { 1133 | "optional": true 1134 | }, 1135 | "lightningcss": { 1136 | "optional": true 1137 | }, 1138 | "sass": { 1139 | "optional": true 1140 | }, 1141 | "sass-embedded": { 1142 | "optional": true 1143 | }, 1144 | "stylus": { 1145 | "optional": true 1146 | }, 1147 | "sugarss": { 1148 | "optional": true 1149 | }, 1150 | "terser": { 1151 | "optional": true 1152 | }, 1153 | "tsx": { 1154 | "optional": true 1155 | }, 1156 | "yaml": { 1157 | "optional": true 1158 | } 1159 | } 1160 | } 1161 | } 1162 | } 1163 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "template-vite-ts", 3 | "description": "A Phaser 3 TypeScript template using Vite.", 4 | "version": "1.4.0", 5 | "repository": { 6 | "type": "git", 7 | "url": "git+https://github.com/phaserjs/template-vite-ts.git" 8 | }, 9 | "author": "Phaser Studio (https://phaser.io/)", 10 | "license": "MIT", 11 | "licenseUrl": "http://www.opensource.org/licenses/mit-license.php", 12 | "bugs": { 13 | "url": "https://github.com/phaserjs/template-vite-ts/issues" 14 | }, 15 | "homepage": "https://github.com/phaserjs/template-vite-ts#readme", 16 | "scripts": { 17 | "dev": "node log.js dev & vite --config vite/config.dev.mjs", 18 | "build": "node log.js build & vite build --config vite/config.prod.mjs", 19 | "dev-nolog": "vite --config vite/config.dev.mjs", 20 | "build-nolog": "vite build --config vite/config.prod.mjs" 21 | }, 22 | "devDependencies": { 23 | "typescript": "~5.7.2", 24 | "vite": "^6.3.1" 25 | }, 26 | "dependencies": { 27 | "phaser": "^3.90.0", 28 | "terser": "^5.39.0" 29 | } 30 | } -------------------------------------------------------------------------------- /public/assets/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaserjs/template-vite-ts/919be730b40018199a202a8a1c92f6ba3687047b/public/assets/bg.png -------------------------------------------------------------------------------- /public/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaserjs/template-vite-ts/919be730b40018199a202a8a1c92f6ba3687047b/public/assets/logo.png -------------------------------------------------------------------------------- /public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaserjs/template-vite-ts/919be730b40018199a202a8a1c92f6ba3687047b/public/favicon.png -------------------------------------------------------------------------------- /public/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | padding: 0; 4 | color: rgba(255, 255, 255, 0.87); 5 | background-color: #0f0f0f; 6 | } 7 | 8 | #app { 9 | width: 100%; 10 | height: 100vh; 11 | overflow: hidden; 12 | display: flex; 13 | justify-content: center; 14 | align-items: center; 15 | } 16 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phaserjs/template-vite-ts/919be730b40018199a202a8a1c92f6ba3687047b/screenshot.png -------------------------------------------------------------------------------- /src/game/main.ts: -------------------------------------------------------------------------------- 1 | import { Boot } from './scenes/Boot'; 2 | import { GameOver } from './scenes/GameOver'; 3 | import { Game as MainGame } from './scenes/Game'; 4 | import { MainMenu } from './scenes/MainMenu'; 5 | import { AUTO, Game } from 'phaser'; 6 | import { Preloader } from './scenes/Preloader'; 7 | 8 | // Find out more information about the Game Config at: 9 | // https://docs.phaser.io/api-documentation/typedef/types-core#gameconfig 10 | const config: Phaser.Types.Core.GameConfig = { 11 | type: AUTO, 12 | width: 1024, 13 | height: 768, 14 | parent: 'game-container', 15 | backgroundColor: '#028af8', 16 | scene: [ 17 | Boot, 18 | Preloader, 19 | MainMenu, 20 | MainGame, 21 | GameOver 22 | ] 23 | }; 24 | 25 | const StartGame = (parent: string) => { 26 | 27 | return new Game({ ...config, parent }); 28 | 29 | } 30 | 31 | export default StartGame; 32 | -------------------------------------------------------------------------------- /src/game/scenes/Boot.ts: -------------------------------------------------------------------------------- 1 | import { Scene } from 'phaser'; 2 | 3 | export class Boot extends Scene 4 | { 5 | constructor () 6 | { 7 | super('Boot'); 8 | } 9 | 10 | preload () 11 | { 12 | // The Boot Scene is typically used to load in any assets you require for your Preloader, such as a game logo or background. 13 | // The smaller the file size of the assets, the better, as the Boot Scene itself has no preloader. 14 | 15 | this.load.image('background', 'assets/bg.png'); 16 | } 17 | 18 | create () 19 | { 20 | this.scene.start('Preloader'); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/game/scenes/Game.ts: -------------------------------------------------------------------------------- 1 | import { Scene } from 'phaser'; 2 | 3 | export class Game extends Scene 4 | { 5 | camera: Phaser.Cameras.Scene2D.Camera; 6 | background: Phaser.GameObjects.Image; 7 | msg_text : Phaser.GameObjects.Text; 8 | 9 | constructor () 10 | { 11 | super('Game'); 12 | } 13 | 14 | create () 15 | { 16 | this.camera = this.cameras.main; 17 | this.camera.setBackgroundColor(0x00ff00); 18 | 19 | this.background = this.add.image(512, 384, 'background'); 20 | this.background.setAlpha(0.5); 21 | 22 | this.msg_text = this.add.text(512, 384, 'Make something fun!\nand share it with us:\nsupport@phaser.io', { 23 | fontFamily: 'Arial Black', fontSize: 38, color: '#ffffff', 24 | stroke: '#000000', strokeThickness: 8, 25 | align: 'center' 26 | }); 27 | this.msg_text.setOrigin(0.5); 28 | 29 | this.input.once('pointerdown', () => { 30 | 31 | this.scene.start('GameOver'); 32 | 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/game/scenes/GameOver.ts: -------------------------------------------------------------------------------- 1 | import { Scene } from 'phaser'; 2 | 3 | export class GameOver extends Scene 4 | { 5 | camera: Phaser.Cameras.Scene2D.Camera; 6 | background: Phaser.GameObjects.Image; 7 | gameover_text : Phaser.GameObjects.Text; 8 | 9 | constructor () 10 | { 11 | super('GameOver'); 12 | } 13 | 14 | create () 15 | { 16 | this.camera = this.cameras.main 17 | this.camera.setBackgroundColor(0xff0000); 18 | 19 | this.background = this.add.image(512, 384, 'background'); 20 | this.background.setAlpha(0.5); 21 | 22 | this.gameover_text = this.add.text(512, 384, 'Game Over', { 23 | fontFamily: 'Arial Black', fontSize: 64, color: '#ffffff', 24 | stroke: '#000000', strokeThickness: 8, 25 | align: 'center' 26 | }); 27 | this.gameover_text.setOrigin(0.5); 28 | 29 | this.input.once('pointerdown', () => { 30 | 31 | this.scene.start('MainMenu'); 32 | 33 | }); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/game/scenes/MainMenu.ts: -------------------------------------------------------------------------------- 1 | import { Scene, GameObjects } from 'phaser'; 2 | 3 | export class MainMenu extends Scene 4 | { 5 | background: GameObjects.Image; 6 | logo: GameObjects.Image; 7 | title: GameObjects.Text; 8 | 9 | constructor () 10 | { 11 | super('MainMenu'); 12 | } 13 | 14 | create () 15 | { 16 | this.background = this.add.image(512, 384, 'background'); 17 | 18 | this.logo = this.add.image(512, 300, 'logo'); 19 | 20 | this.title = this.add.text(512, 460, 'Main Menu', { 21 | fontFamily: 'Arial Black', fontSize: 38, color: '#ffffff', 22 | stroke: '#000000', strokeThickness: 8, 23 | align: 'center' 24 | }).setOrigin(0.5); 25 | 26 | this.input.once('pointerdown', () => { 27 | 28 | this.scene.start('Game'); 29 | 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/game/scenes/Preloader.ts: -------------------------------------------------------------------------------- 1 | import { Scene } from 'phaser'; 2 | 3 | export class Preloader extends Scene 4 | { 5 | constructor () 6 | { 7 | super('Preloader'); 8 | } 9 | 10 | init () 11 | { 12 | // We loaded this image in our Boot Scene, so we can display it here 13 | this.add.image(512, 384, 'background'); 14 | 15 | // A simple progress bar. This is the outline of the bar. 16 | this.add.rectangle(512, 384, 468, 32).setStrokeStyle(1, 0xffffff); 17 | 18 | // This is the progress bar itself. It will increase in size from the left based on the % of progress. 19 | const bar = this.add.rectangle(512-230, 384, 4, 28, 0xffffff); 20 | 21 | // Use the 'progress' event emitted by the LoaderPlugin to update the loading bar 22 | this.load.on('progress', (progress: number) => { 23 | 24 | // Update the progress bar (our bar is 464px wide, so 100% = 464px) 25 | bar.width = 4 + (460 * progress); 26 | 27 | }); 28 | } 29 | 30 | preload () 31 | { 32 | // Load the assets for the game - Replace with your own assets 33 | this.load.setPath('assets'); 34 | 35 | this.load.image('logo', 'logo.png'); 36 | } 37 | 38 | create () 39 | { 40 | // When all the assets have loaded, it's often worth creating global objects here that the rest of the game can use. 41 | // For example, you can define global animations here, so we can use them in other scenes. 42 | 43 | // Move to the MainMenu. You could also swap this for a Scene Transition, such as a camera fade. 44 | this.scene.start('MainMenu'); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import StartGame from './game/main'; 2 | 3 | document.addEventListener('DOMContentLoaded', () => { 4 | 5 | StartGame('game-container'); 6 | 7 | }); -------------------------------------------------------------------------------- /src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2020", 4 | "useDefineForClassFields": true, 5 | "module": "ESNext", 6 | "lib": [ 7 | "ES2020", 8 | "DOM", 9 | "DOM.Iterable" 10 | ], 11 | "skipLibCheck": true, 12 | /* Bundler mode */ 13 | "moduleResolution": "bundler", 14 | "allowImportingTsExtensions": true, 15 | "isolatedModules": true, 16 | "moduleDetection": "force", 17 | "noEmit": true, 18 | /* Linting */ 19 | "strictPropertyInitialization": false, 20 | "strict": true, 21 | "noUnusedLocals": true, 22 | "noUnusedParameters": true, 23 | "noFallthroughCasesInSwitch": true, 24 | "noUncheckedSideEffectImports": true 25 | }, 26 | "include": [ 27 | "src" 28 | ] 29 | } -------------------------------------------------------------------------------- /vite/config.dev.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | 3 | export default defineConfig({ 4 | base: './', 5 | build: { 6 | rollupOptions: { 7 | output: { 8 | manualChunks: { 9 | phaser: ['phaser'] 10 | } 11 | } 12 | }, 13 | }, 14 | server: { 15 | port: 8080 16 | } 17 | }); 18 | -------------------------------------------------------------------------------- /vite/config.prod.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite'; 2 | 3 | const phasermsg = () => { 4 | return { 5 | name: 'phasermsg', 6 | buildStart() { 7 | process.stdout.write(`Building for production...\n`); 8 | }, 9 | buildEnd() { 10 | const line = "---------------------------------------------------------"; 11 | const msg = `❤️❤️❤️ Tell us about your game! - games@phaser.io ❤️❤️❤️`; 12 | process.stdout.write(`${line}\n${msg}\n${line}\n`); 13 | 14 | process.stdout.write(`✨ Done ✨\n`); 15 | } 16 | } 17 | } 18 | 19 | export default defineConfig({ 20 | base: './', 21 | logLevel: 'warning', 22 | build: { 23 | rollupOptions: { 24 | output: { 25 | manualChunks: { 26 | phaser: ['phaser'] 27 | } 28 | } 29 | }, 30 | minify: 'terser', 31 | terserOptions: { 32 | compress: { 33 | passes: 2 34 | }, 35 | mangle: true, 36 | format: { 37 | comments: false 38 | } 39 | } 40 | }, 41 | server: { 42 | port: 8080 43 | }, 44 | plugins: [ 45 | phasermsg() 46 | ] 47 | }); 48 | --------------------------------------------------------------------------------