Skip to content

Commit 85a9014

Browse files
committed
Merge remote-tracking branch 'upstream/master' into feature-multi-image-loader
2 parents 8e15d3c + 116e62f commit 85a9014

226 files changed

Lines changed: 259487 additions & 183034 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"linebreak-style": [ "off" ],
5252
"lines-around-comment": [ "error", { "beforeBlockComment": true, "afterBlockComment": false, "beforeLineComment": true, "afterLineComment": false, "allowBlockStart": true, "allowBlockEnd": false, "allowObjectStart": true, "allowArrayStart": true }],
5353
"new-parens": "error",
54+
"no-constant-condition": 0,
5455
"no-array-constructor": "error",
5556
"no-lonely-if": "error",
5657
"no-mixed-spaces-and-tabs": "error",

.github/CONTRIBUTING.md

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,54 +18,57 @@ Before contributing, please read the [code of conduct](https://github.com/photon
1818

1919
**5. Share as much information as possible.** Include browser version affected, your OS, version of the library, steps to reproduce, etc. "X isn't working!!!1!" will probably just be closed.
2020

21+
## Support Forum
2122

22-
## Pixi and Phaser
23+
We have a very active [Phaser Support Forum][4]. If you need general support, or are struggling to understand how to do something or need your code checked over, then we would urge you to post it to our forum. There are a lot of friendly devs in there who can help, as well as the core Phaser team, so it's a great place to get support. You're welcome to report bugs directly on GitHub, but for general support we'd always recommend using the forum first.
2324

24-
Phaser doesn't use Pixi anymore.
25+
## Making Changes
2526

27+
I'm assuming you already have a recent version of [Node](https://nodejs.org) installed locally and can run `npm`. This guide is tested and works on both Windows 10 and OS X.
2628

27-
## Support Forum
29+
### 1. Checkout the repos
2830

29-
We have a very active [Phaser Support Forum][4]. If you need general support, or are struggling to understand how to do something or need your code checked over, then we would urge you to post it to our forum. There are a lot of friendly devs in there who can help, as well as the core Phaser and Pixi teams, so it's a great place to get support from. You're welcome to report bugs directly on GitHub, but for general support we'd always recommend using the forum first.
31+
Check-out both the [Phaser repo](https://github.com/photonstorm/phaser) and the [Phaser 3 Examples Repo](https://github.com/photonstorm/phaser3-examples). Make sure the Phaser 3 Examples repo is saved locally in a folder called `phaser3-examples`, which will be the default for most Git clients.
3032

33+
### 2. Matching Directory Levels
3134

32-
## Making Changes
35+
Ensure that both repos live at the same depth in your directory structure. For example: `/usr/home/web/phaser` and `/usr/home/web/phaser3-examples`. This is so the dev build scripts in the Phaser repo can safely copy files to `../phaser3-examples` and have them end up in the correct place.
3336

34-
To take advantage of our grunt build script and jshint config it will be easiest for you if you have node.js and grunt installed locally.
37+
### 3. Install dependencies
3538

36-
You can download node.js from [nodejs.org][3]. After it has been installed open a console and run `npm i -g grunt-cli` to install the global `grunt` executable.
39+
Using your console, run `npm install` or `yarn install` as we've configs for both. This process will install a local copy of webpack and a handful of small support scripts. Note that Yarn on Windows seems to have issues making some packages global, so stick with npm if this is the case.
3740

38-
After that you can clone the repository and run `npm i` inside the cloned folder. This will install dependencies necessary for building the project. Once that is ready,
39-
make your changes and submit a Pull Request:
41+
### 4. Webpack
4042

41-
- **Send Pull Requests to the `master` branch.** We _used_ to insist PRs went to `dev` but have removed this policy since the release of Phaser CE.
43+
Making sure you've got both repos checked out, and at the same directory level in your filesystem, issue the command `webpack`. If you can't issue the command then webpack may need [installing globally](https://webpack.js.org/guides/installation/). Webpack will build Phaser and if there are any path errors in the code they'll be flagged during the build process.
4244

43-
- **Ensure changes are jshint validated.** Our JSHint configuration file is provided in the repository and you should check against it before submitting.
45+
What you need is the ability to issue the command `webpack` within the v3 folder and have it work.
4446

45-
- **Never commit new builds.** When making a code change you should always run `grunt` which will rebuild the project so you can test, *however* please do not commit these new builds or your PR will be closed. Builds by default are placed in the `dist` folder, to keep them separate from the `build` folder releases.
47+
### 5. ESLint
4648

47-
- **Only commit relevant changes.** Don't include changes that are not directly relevant to the fix you are making. The more focused a PR is, the faster it will get attention and be merged. Extra files changing only whitespace or trash files will likely get your PR closed.
49+
There is an ESLint configuration and an Editor Configuration in the v3 folder. **Please adhere to them!** Although not enforced in the build process yet, I will be adding that at a later point. There are lots of tools you can install so your editor of choice will check the ESLint config during development.
4850

51+
To test if your code passes our lint config issue the command `npm run lint`.
4952

5053
## Coding style preferences are not contributions
5154

5255
If your PR is doing little more than changing the Phaser source code into a format / coding style that you prefer then we will automatically close it. All PRs must adhere to the coding style already set-out across the thousands of lines of code in Phaser. Your personal preferences for how things should "look" or be structured do not apply here, sorry. PRs should fix bugs, fix documentation or add features. No changes for the sake of change.
5356

54-
5557
## I don't really like git / node.js, but I can fix this bug
5658

5759
That is fine too. While Pull Requests are the best thing in the world for us, they are not the only way to help. You're welcome to post fixes to our forum or even just email them to us. All we ask is that you still adhere to the guidelines presented here re: JSHint, etc.
5860

59-
6061
## Code Style Guide
6162

63+
We provide an .editorconfig and eslint config for you to use, but generally:
64+
6265
- Use 4 spaces for tabs, never tab characters.
6366

6467
- No trailing whitespace, blank lines should have no whitespace.
6568

6669
- Always favor strict equals `===` unless you *need* to use type coercion.
6770

68-
- Follow conventions already in the code, and listen to jshint. Our config is set-up for a reason.
71+
- Follow conventions already in the code, and listen to eslint. Our config is set-up for a reason.
6972

7073
Thanks to Chad for creating the original Pixi.js Contributing file which we adapted for Phaser.
7174

.github/ISSUE_TEMPLATE.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
1-
**This repo is for Phaser 3 related issues only**
1+
This repo is for Phaser 3 related issues only. If you've found an issue with Phaser 2 please see the [Phaser CE (Community Edition)](https://github.com/photonstorm/phaser-ce) repo instead.
22

3-
Official support for Phaser 2 has now ended. We urge you to visit the [Phaser CE (Community Edition)](https://github.com/photonstorm/phaser-ce) for continued development of v2.
4-
5-
This Issue is about (delete as applicable)
6-
7-
* A bug in the API (always say which version you're using!)
8-
* An error in the documentation
9-
* An error in the TypeScript defs
10-
* An error on the web site
11-
* A problem with my own code
3+
This should not be used for technical support. If you're struggling trying to use Phaser then post your question to the [forum](http://www.html5gamedevs.com/forum/33-phaser-3/), [Slack](https://phaser.io/community/slack) or [Discord](https://phaser.io/community/discord) channels. GitHub Issues are for bugs and feature requests only.
124

135
API errors must include example code showing what happens, and why you don't believe this is the expected behavior. Issues posted without code take _far_ longer to get resolved, _if ever_. Feel free to use a site such as jsBin or [CodePen](https://codepen.io/pen?template=YeEWom) to demo the problem. If we can run it, and see the error, we can usually fix it.
146

15-
If your Issue contains _any_ form of hostility it will be instantly closed.
7+
If your Issue contains _any_ form of hostility it will be instantly closed and you will be blocked from access to all our repos.
168

179
**Be nice. We do this for free.**

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
** >> Make sure you describe your PR to the README Change Log section! << **
1+
Please do not update the README or Change Log, we will do this when we merge your PR.
22

3-
This PR changes (delete as applicable)
3+
This PR (delete as applicable)
44

5-
* Documentation
6-
* TypeScript Defs
7-
* The public-facing API
8-
* Nothing, it's a bug fix
5+
* Updates the Documentation
6+
* Adds a new feature
7+
* Fixes a bug
98

109
Describe the changes below:
1110

CHANGELOG.md

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,81 @@
11
# Change Log
22

3-
## Version 3.5.0 - in development
3+
## Version 3.6.1 - Asuna - in development
4+
5+
### New Features
6+
7+
* The Phaser 3 Labs has gained a nifty 'search' feature box thanks to @NemoStein - it allows you to filter out the example categories.
8+
* We've added a Mask component, which is available on nearly all Game Objects. It includes the methods `setMask`, `clearMask`, `createBitmapMask` and `createGeometryMask`.
9+
10+
### Updates
11+
12+
* If you're using Webpack with Phaser you'll need to update your config to match our new one.
13+
* We've swapped use of the Webpack DefinePlugin so instead of setting a global flag for the compilation of the Canvas and WebGL renderers, we now use a typeof check instead. This means you should now be able to ingest the Phaser source more easily outside of Webpack without having to define any global vars first (thanks @tgrajewski)
14+
* Under Webpack we still use the raw-loader to import our shader source, but outside of Webpack we now use `require.extensions` to load the shader source via fs. This should allow you to bundle Phaser with packages other than Webpack more easily (thanks @tgrajewski)
15+
* The Texture Manager will now emit an `addtexture` event whenever you add a new texture to it, which includes when you load images files from the Loader (as it automatically populates the Texture Manager). Once you receive an `addtexture` event you know the image is loaded and the texture is safe to be applied to a Game Object.
16+
17+
### Bug Fixes
18+
19+
* DataManagerPlugin would throw an error on Game.destroy if you had any Scenes in the Scene Manager had not been run. Fix #3596 (thanks @kuoruan)
20+
21+
### Examples, Documentation and TypeScript
22+
23+
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:
24+
25+
@wtravO
26+
27+
## Version 3.6.0 - Asuna - 19th April 2018
28+
29+
### New Features
30+
31+
* Containers are now fully available! We have removed the beta warning and fixed the way in which they work with Cameras, input and scroll factors. They are also fully documented, so please see their docs and examples for use.
32+
* Group.getLast will return the last member in the Group matching the search criteria.
33+
* Group.getFirstNth will return the nth member in the Group, scanning from top to bottom, that matches the search criteria.
34+
* Group.getLastNth will return the nth member in the Group, scanning in reverse, that matches the search criteria.
35+
* Group.remove has a new optional argument `destroyChild` that will call `destroy` on the child after removing it.
36+
* Group.clear has a new optional argument `destroyChild` that will call `destroy` on all children in the Group after removing them.
37+
38+
### Updates
39+
40+
* Impact Physics Game Objects have changed `setLite` to `setLiteCollision`.
41+
* Impact Physics Game Objects have changed `setPassive` to `setPassiveCollision`.
42+
* Impact Physics Game Objects have changed `setFixed` to `setFixedCollision`.
43+
* Impact Physics Game Objects have changed `setActive` to `setActiveCollision`, previously the `setActive` collision method was overwriting the Game Objects `setActive` method, hence the renaming.
44+
* The modifications made to the RTree class in Phaser 3.4.0 to avoid CSP policy violations caused a significant performance hit once a substantial number of bodies were involved. We have recoded how the class deals with its accessor formats and returned to 3.3 level performance while still maintaining CSP policy adherence. Fix #3594 (thanks @16patsle)
45+
* The Retro Font namespace has changed to `Phaser.GameObjects.RetroFont`. Previously, you would access the parser and constants via `BitmapText`, i.e.: `Phaser.GameObjects.BitmapText.ParseRetroFont.TEXT_SET6`. This has now changed to its own namespace, so the same line would be: `Phaser.GameObjects.RetroFont.TEXT_SET6`. The Parser is available via `Phaser.GameObjects.RetroFont.Parse`. This keeps things cleaner and also unbinds RetroFont from BitmapText, allowing you to cleanly exclude it from your build should you wish. All examples have been updated to reflect this.
46+
* If using the `removeFromScene` option in Group.remove or Group.clear it will remove the child/ren from the Scene to which they belong, not the Scene the Group belongs to.
47+
48+
### Bug Fixes
49+
50+
* Fixed a bug that caused data to not be passed to another Scene if you used a transition to start it. Fix #3586 (thanks @willywu)
51+
* Group.getHandler would return any member of the Group, regardless of the state, causing pools to remain fixed at once member. Fix #3592 (thanks @samme)
52+
53+
### Examples, Documentation and TypeScript
54+
55+
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:
56+
57+
@Fabadiculous @Antriel
58+
59+
## Version 3.5.1 - Kirito - 17th April 2018
60+
61+
### Updates
62+
63+
* The change made in 3.5.0 with how the Scene systems lifecycle is handled has been tweaked. When a Scene is instantiated it will now emit a boot event, as before, and Systems that need it will listen for this event and set-up their internal properties as required. They'll also do the same under the 'start' event, allowing them to restart properly once shutdown. In 3.5 if a Scene was previously not launched or started you wouldn't be able to access all of its internal systems fully, but in 3.5.1 you can.
64+
65+
### Bug Fixes
66+
67+
* LoaderPlugin.destroy would try and remove an incorrect event listener.
68+
* TileSprites would try to call `deleteTexture` on both renderers, but it's only available in WebGL (thanks @jmcriat)
69+
* Using a geometry mask stopped working in WebGL. Fix #3582 (thanks @rafelsanso)
70+
* The particle emitter incorrectly adjusted the vertex count, causing WebGL rendering issues. Fix #3583 (thanks @murteira)
71+
72+
### Examples, Documentation and TypeScript
73+
74+
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:
75+
76+
@NemoStein @gabegordon @gazpachu @samme @cristlee @melissaelopez @dazigemm @tgrajewski
77+
78+
## Version 3.5.0 - Kirito - 16th April 2018
479

580
### Changes to Cameras
681

@@ -45,6 +120,8 @@ Please see the complete JSDocs for the ScenePlugin for more details, as well as
45120
* Group.remove didn't check if the passed Game Object was already a member of the group and would call `removeCallback` and (if specified) `destroy` in any case. Now it does nothing if the Game Object isn't a member of the group (thanks @samme)
46121
* If a Group size exceeded `maxSize` (which can happen if you reduce maxSize beneath the current size), `isFull` would return false and the group could continue to grow. Now `isFull` returns true in that case (thanks @samme)
47122
* Camera.fadeIn following a fadeOut wouldn't work, but is now fixed as a result of the Camera effects rewrite. Fix #3527 (thanks @Jerenaux)
123+
* Particle Emitters with large volumes of particles would throw the error `GL_INVALID_OPERATION: Vertex buffer is not big enough for the draw call` in WebGL.
124+
* Fixed issue with Game.destroy not working correctly under WebGL since 3.4. Fix #3569 (thanks @Huararanga)
48125

49126
### Updates
50127

@@ -53,12 +130,14 @@ Please see the complete JSDocs for the ScenePlugin for more details, as well as
53130
* Every Plugin has been updated to correctly follow the same flow through the Scene lifecycle. Instead of listening for the Scene 'boot' event, which is only dispatched once (when the Scene is first created), they will now listen for the Scene 'start' event, which occurs every time the Scene is started. All plugins now consistently follow the same Shutdown and Destroy patterns too, meaning they tidy-up after themselves on a shutdown, not just a destroy. Overall, this change means that there should be less issues when returning to previously closed Scenes, as the plugins will restart themselves properly.
54131
* When shutting down a Scene all Game Objects that belong to the scene will now automatically destroy themselves. They would previously be removed from the display and update lists, but the objects themselves didn't self-destruct. You can control this on a per-object basis with the `ignoreDestroy` property.
55132
* A Matter Mouse Spring will disable debug draw of its constraint by default (you can override it by passing in your own config)
133+
* The RandomDataGenerator class is now exposed under Phaser.Math should you wish to instantiate it yourself. Fix #3576 (thanks @wtravO)
134+
* Refined the Game.destroy sequence, so it will now only destroy the game at the start of the next frame, not during processing.
56135

57136
### Examples, Documentation and TypeScript
58137

59138
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:
60139

61-
@samme
140+
@samme @Antriel
62141

63142
## Version 3.4.0 - Miyako - 12th April 2018
64143

0 commit comments

Comments
 (0)