Skip to content

Commit 06c80b0

Browse files
committed
- update readme
1 parent 0eec0b8 commit 06c80b0

File tree

2 files changed

+6
-112
lines changed

2 files changed

+6
-112
lines changed

README.md

Lines changed: 6 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -20,132 +20,26 @@ This template has been updated for:
2020

2121
## Available Commands
2222

23-
| Command | Description |
24-
|---------|-------------|
25-
| `npm install` | Install project dependencies |
26-
| `npm run dev` | Launch a development web server |
23+
| Command | Description |
24+
| --------------- | ---------------------------------------------- |
25+
| `npm install` | Install project dependencies |
26+
| `npm run dev` | Launch a development web server |
2727
| `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) |
3028

3129
## Writing Code
3230

3331
After cloning the repo, run `npm install` from your project directory. Then, you can start the local development server by running `npm run dev`.
3432

35-
The local development server runs on `http://localhost:8080` by default. Please see the esbuild 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. esbuild 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-
- `public/index.html` - A basic HTML page to contain the game.
44-
- `src` - Contains the game source code.
45-
- `src/main.ts` - The main entry point. This contains the game configuration and starts the game.
46-
- `src/scenes/` - The Phaser Scenes are in this folder.
47-
- `src/global.d.ts` - Global TypeScript declarations, provide types information.
48-
- `public/style.css` - Some simple CSS rules to help with page layout.
49-
- `public/assets` - Contains the static assets used by the game.
50-
51-
## Handling Assets
52-
53-
esbuild supports loading assets via JavaScript module `import` statements (not recommended).
54-
55-
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:
56-
57-
```js
58-
import logoImg from './logo.png'
59-
```
60-
61-
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:
62-
63-
```js
64-
preload ()
65-
{
66-
// This is an example of an imported bundled image.
67-
// Remember to import it at the top of this file
68-
this.load.image('logo', logoImg);
69-
70-
// This is an example of loading a static image
71-
// from the public/assets folder:
72-
this.load.image('background', 'assets/bg.png');
73-
}
74-
```
75-
76-
When you issue the `npm run build` command, all static assets are automatically copied to the `dist/assets` folder.
33+
The local development server runs on `http://localhost:4101` by default.
7734

7835
## Deploying to Production
7936

8037
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.
8138

82-
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.
39+
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.
8340

8441
## Customizing the Template
8542

8643
### esbuild
8744

8845
If you want to customize your build, such as adding plugin (i.e. for loading CSS or fonts), you can modify the `esbuild/build.prod.mjs` and `esbuild/dev.server.mjs` files 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 [esbuild documentation](https://esbuild.github.io/api/) for more information.
89-
90-
## About log.js
91-
92-
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.
93-
94-
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.
95-
96-
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.
97-
98-
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.
99-
100-
However, if you don't want to send any data, you can use these commands instead:
101-
102-
Dev:
103-
104-
```bash
105-
npm run dev-nolog
106-
```
107-
108-
Build:
109-
110-
```bash
111-
npm run build-nolog
112-
```
113-
114-
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`:
115-
116-
Before:
117-
118-
```json
119-
"scripts": {
120-
"dev": "node log.js dev & dev-template-script",
121-
"build": "node log.js build & build-template-script"
122-
},
123-
```
124-
125-
After:
126-
127-
```json
128-
"scripts": {
129-
"dev": "dev-template-script",
130-
"build": "build-template-script"
131-
},
132-
```
133-
134-
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.
135-
136-
## Join the Phaser Community!
137-
138-
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 😄
139-
140-
**Visit:** The [Phaser website](https://phaser.io) and follow on [Phaser Twitter](https://twitter.com/phaser_)<br />
141-
**Play:** Some of the amazing games [#madewithphaser](https://twitter.com/search?q=%23madewithphaser&src=typed_query&f=live)<br />
142-
**Learn:** [API Docs](https://newdocs.phaser.io), [Support Forum](https://phaser.discourse.group/) and [StackOverflow](https://stackoverflow.com/questions/tagged/phaser-framework)<br />
143-
**Discord:** Join us on [Discord](https://discord.gg/phaser)<br />
144-
**Code:** 2000+ [Examples](https://labs.phaser.io)<br />
145-
**Read:** The [Phaser World](https://phaser.io/community/newsletter) Newsletter<br />
146-
147-
Created by [Phaser Studio](mailto:[email protected]). Powered by coffee, anime, pixels and love.
148-
149-
The Phaser logo and characters are &copy; 2011 - 2024 Phaser Studio Inc.
150-
151-
All rights reserved.

screenshot.png

853 KB
Loading

0 commit comments

Comments
 (0)