Skip to content

Commit 38dc3bb

Browse files
committed
Merge branch 'master' of https://github.com/photonstorm/phaser
2 parents 98893e1 + 8d85a9b commit 38dc3bb

36 files changed

Lines changed: 1180 additions & 186 deletions

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://travis-ci.org/photonstorm/
2+
3+
git:
4+
depth: 1
5+
6+
language: node_js
7+
node_js:
8+
- 'node'
9+
10+
env:
11+
- TERM=dumb
12+
13+
script:
14+
- yarn install
15+
- yarn run lint
16+
- yarn run build

CHANGELOG.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
### New Features
66

7+
* The new Render Texture Game Object is now available. You can clear, fill and draw texture frames to it. The Render Texture itself can be displayed in-game with its own transform, or you can use it as a Bitmap Mask for another Game Object.
78
* Game.resize allows you to resize the game config, renderer and input system in one call.
9+
* When Game.resize is called it causes all Scene.Systems to have their resize method called. This is turn emits a `resize` event which your Scene can respond to. It will be sent the new width and height of the canvas as the only two parameters.
810
* InputManager.resize allows you to update the bounds def and input scale in one call.
911
* Game.Config.roundPixels property added to prevent sub-pixel interpolation during rendering of Game Objects in WebGL and Canvas.
1012
* Load.plugin now accepts a class as an argument as well as a URL string (thanks @nkholski)
@@ -13,6 +15,12 @@
1315
* GameObject.setInteractive has a new boolean argument `dropZone` which will allow you to set the object as being a drop zone right from the method.
1416
* Sprites can now be drop zones and have other Game Objects dragged onto them as targets.
1517
* The SceneManager has a new method: `remove` which allows you to remove and destroy a Scene, freeing up the Scene key for use by future scenes and potentially clearing the Scene from active memory for gc.
18+
* SceneManager.moveAbove will move a Scene to be directly above another Scene in the Scenes list. This is also exposed in the ScenePlugin.
19+
* SceneManager.moveBelow will move a Scene to be directly below another Scene in the Scenes list. This is also exposed in the ScenePlugin.
20+
* Quadratic Bezier Interpolation has been added to the Math.Interpolation functions (thanks @RiCoTeRoX)
21+
* A new Quadratic Bezier Curve class has been added, expanding the available Curve types (thanks @RiCoTeRoX)
22+
* Path.quadraticBezierTo allows you to add a Quadratic Bezier Curve into your Path.
23+
* Loader.multiatlas now supports Texture Packers new JSON atlas format which exports one combined atlas for all image files. This is available if you use the new Phaser 3 Export from within Texture Packer (thanks @CodeAndWeb)
1624

1725
### Bug Fixes
1826

@@ -26,6 +34,10 @@
2634
* InputPlugin.clear now properly removes a Game Object from all internal arrays, not just the _list.
2735
* InputPlugin.processOverOut no longer considers an item as being 'out' if it's in the internal `_drag` array.
2836
* When a Game Object is scaled, its Arcade Physics body was still calculating its position based on its original size instead of scaled one (thanks @pixelpicosean)
37+
* The RandomDataGenerator classes randomness has been improved thanks to the correct caching of a class property. Fix #3289 (thanks @migiyubi)
38+
* The RandomDataGenerator `sign` property had a method collision. Fix #3323 (thanks @vinerz and @samme)
39+
* In Arcade Physics World if you collided a group with itself it would call a missing method (`collideGroupVsSelf`), it now calls `collideGroupVsGroup` correctly (thanks @patrickgalbraith)
40+
* The HTML5 Sound Manager would unlock the Sound API on a touch event but only if the audio files were loaded in the first Scene, if they were loaded in a subsequent Scene the audio system would never unlock. It now unlocks only if there are audio files in the cache. Fix #3311 (thanks @chancezeus)
2941

3042
### Updates
3143

@@ -37,9 +49,12 @@
3749
* If you set `transparent` in the Game Config but didn't provide a `backgroundColor` then it would render as black. It will now be properly transparent. If you do provide a color value then it must include an alpha component.
3850
* You can now pass normal Groups to Arcade Physics collide / overlap, as well as Physics Groups. Fix #3277 (thanks @nkholski)
3951
* Texture.get has been optimized to fail first, then error, with a new falsey check. This allows you to skip out specifying animation frames in the animation config without generating a console warning.
40-
41-
* Documentation updates: thanks to @melissaelopez @samme
42-
52+
* The `setFrame` method of the Texture component has been updated so that it will now automatically reset the `width` and `height` of a Game Object to match that of the new Frame. Related, it will also adjust the display origin values, because they are size based. If the Frame has a custom pivot it will set the origin to match the custom pivot instead.
53+
* ScenePlugin.swapPosition now allows you to use it to swap the positions of any two Scenes. Before the change it only allowed you to swap the position of the calling Scene and another one, but a new optional `keyB` argument opens this up.
54+
* The SceneManager no longer renders a Scene unless it is visible AND either running or paused. This now skips Scenes that are in an `init` state.
55+
* The Keyboard Manager will now no longer emit `keydown` events if you keep holding a key down. Fix #3239 (thanks @squaresun)
56+
* Phaser is now running Travis CI build testing again (thanks @vpmedia)
57+
* Documentation updates: thanks to @melissaelopez @samme @jblang94
4358

4459
## Version 3.1.2 - 23rd February 2018
4560

README.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
![Phaser Header](https://phaser.io/images/github/300/phaser-header.png "Phaser 3 Header Banner")
44

5-
Phaser is a fast, free, and fun open source HTML5 game framework. It offers WebGL and Canvas rendering across desktop and mobile web browsers. Games can be compiled to iOS, Android and native apps via 3rd party tools. You can use JavaScript or TypeScript for development.
5+
Phaser is a fast, free, and fun open source HTML5 game framework that offers WebGL and Canvas rendering across desktop and mobile web browsers. Games can be compiled to iOS, Android and native apps by using 3rd party tools. You can use JavaScript or TypeScript for development.
66

7-
Phaser is available in two versions: Phaser 3 and [Phaser CE - The Community Edition](https://github.com/photonstorm/phaser-ce). Phaser CE is a community-lead continuation of the Phaser 2 codebase and is hosted on its own repo. Phaser 3 is the next generation of Phaser.
7+
Phaser is available in two versions: Phaser 3 and [Phaser CE - The Community Edition](https://github.com/photonstorm/phaser-ce). Phaser CE is a community-lead continuation of the Phaser 2 codebase and is hosted on a separate repo. Phaser 3 is the next generation of Phaser.
88

99
Along with the fantastic open source community, Phaser is actively developed and maintained by [Photon Storm](http://www.photonstorm.com). As a result of rapid support, and a developer friendly API, Phaser is currently one of the [most starred](https://github.com/collections/javascript-game-engines) game frameworks on GitHub.
1010

11-
Thousands of developers worldwide use Phaser. From indies and multi-national digital agencies, to schools and Universities. Each creating their own incredible [games](https://phaser.io/games/).
11+
Thousands of developers from indie and multi-national digital agencies, and universities worldwide use Phaser. You can take a look at their incredible [games](https://phaser.io/games/).
1212

1313
**Visit:** The [Phaser website](https://phaser.io) and follow on [Twitter](https://twitter.com/phaser_) (#phaserjs)<br />
1414
**Learn:** [API Docs](https://github.com/photonstorm/phaser3-docs), [Support Forum][forum] and [StackOverflow](https://stackoverflow.com/questions/tagged/phaser-framework)<br />
@@ -18,7 +18,7 @@ Thousands of developers worldwide use Phaser. From indies and multi-national dig
1818
**Extend:** With [Phaser Plugins](https://phaser.io/shop/plugins)<br />
1919
**Be awesome:** [Support](#support) the future of Phaser<br />
2020

21-
Grab the source and join in the fun!
21+
Grab the source and join the fun!
2222

2323
![What's New](https://phaser.io/images/github/div-whats-new.png "What's New")
2424

@@ -68,9 +68,9 @@ Extra special thanks to our top-tier sponsors: [Orange Games](http://orangegames
6868

6969
<div align="center"><img src="https://phaser.io/images/github/phaser-world.png"></div>
7070

71-
Every Monday we publish the [Phaser World](https://phaser.io/community/newsletter) newsletter. It's packed full of the latest Phaser games, tutorials, videos, meet-ups, talks, and more. It also contains our weekly Development Progress updates, where you can read about what new features we've been working on.
71+
Every Monday we publish the [Phaser World](https://phaser.io/community/newsletter) newsletter. It's packed full of the latest Phaser games, tutorials, videos, meet-ups, talks, and more. The newsletter also contains our weekly Development Progress updates which let you know about the new features we're working on.
7272

73-
Over 100 previous editions can found on our [Back Issues](http://phaser.io/community/backissues) page.
73+
Over 100 previous editions can be found on our [Back Issues](http://phaser.io/community/backissues) page.
7474

7575
![Download Phaser](https://phaser.io/images/github/div-download.png "Download Phaser")
7676
<a name="download"></a>
@@ -91,7 +91,9 @@ npm install phaser
9191

9292
### CDN
9393

94-
[Phaser is on jsDelivr](http://www.jsdelivr.com/projects/phaser), a "super-fast CDN for developers". Include the following in your html:
94+
[![](https://data.jsdelivr.com/v1/package/gh/photonstorm/phaser/badge)](https://www.jsdelivr.com/package/gh/photonstorm/phaser)
95+
96+
[Phaser is on jsDelivr](http://www.jsdelivr.com/projects/phaser) which is a "super-fast CDN for developers". Include the following in your html:
9597

9698
```html
9799
<script src="//cdn.jsdelivr.net/npm/phaser@3.1.2/dist/phaser.js"></script>
@@ -112,7 +114,7 @@ Phaser is released under the [MIT License](https://opensource.org/licenses/MIT).
112114

113115
<img src="https://phaser.io/images/github/learn.jpg" align="right">
114116

115-
Phaser 3 is so brand new the paint is still wet, but tutorials and guides are starting to come out!
117+
Phaser 3 is so brand new the "paint is still wet", but tutorials and guides are starting to come out!
116118

117119
* [Getting Started with Phaser 3](https://phaser.io/tutorials/getting-started-phaser3) (useful if you are completely new to Phaser)
118120
* [Making your first Phaser 3 Game](https://phaser.io/tutorials/making-your-first-phaser-3-game)
@@ -122,7 +124,7 @@ Also, please subscribe to the [Phaser World](https://phaser.io/community/newslet
122124

123125
### Source Code Examples
124126

125-
During our development of Phaser 3 we created hundreds of examples, with the full source code and assets available. Until those are fully integrated with the Phaser web site, you'll have to browse them in the [Phaser 3 Labs](http://labs.phaser.io), or clone the [examples repo][examples]. Note: Not all examples work, sorry! We're tidying them up as fast as we can.
127+
During our development of Phaser 3, we created hundreds of examples with the full source code and assets. Until these examples are fully integrated into the Phaser website, you can browse them on [Phaser 3 Labs](http://labs.phaser.io), or clone the [examples repo][examples]. Note: Not all examples work, sorry! We're tidying them up as fast as we can.
126128

127129
### Create Your First Phaser 3 Example
128130

@@ -142,7 +144,7 @@ Create an `index.html` page locally and paste the following code into it:
142144
</html>
143145
```
144146

145-
This is a standard empty web page. You'll notice it's pulling in a build of Phaser 3 in the script tag, but otherwise doesn't do anything yet. Now let's set-up the game config. Paste the following between the `<script></script>` tags:
147+
This is a standard empty webpage. You'll notice there's a script tag that is pulling in a build of Phaser 3, but otherwise this webpage doesn't do anything yet. Now let's set-up the game config. Paste the following between the `<script></script>` tags:
146148

147149
```javascript
148150
var config = {
@@ -162,7 +164,7 @@ var config = {
162164
};
163165
```
164166

165-
This is a pretty standard Phaser 3 Game Configuration object. We'll tell it to use the WebGL renderer if it can, set the canvas to a size of 800x600 pixels, enable Arcade Physics and finally call the `preload` and `create` functions. These don't exist yet, so if you run this it will just error. So add the following after the config object:
167+
`config` is a pretty standard Phaser 3 Game Configuration object. We tell `config` to use the WebGL renderer if it can, set the canvas to a size of 800x600 pixels, enable Arcade Physics, and finally call the `preload` and `create` functions. `preload` and `create` have not been implemented yet, so if you run this JavaScript code, you will have an error. Add the following after `config`:
166168

167169
```javascript
168170
var game = new Phaser.Game(config);
@@ -181,9 +183,9 @@ function create ()
181183
}
182184
```
183185

184-
This creates a Phaser Game instance, using our configuration object. It also provides the two functions it needs. The `preload` function is a way to easily load assets into your game. Here we'll set the Base URL to be the Phaser server and grab down 3 PNG files.
186+
`game` is a Phaser Game instance that uses our configuration object `config`. We also add function definitions for `preload` and `create`. The `preload` function helps you easily load assets into your game. In `preload`, we set the Base URL to be the Phaser server and load 3 PNG files.
185187

186-
The create function is empty, so it's time to fill it in:
188+
The `create` function is empty, so it's time to fill it in:
187189

188190
```javascript
189191
function create ()
@@ -208,33 +210,33 @@ function create ()
208210
}
209211
```
210212

211-
Here we're adding the sky image into the game. Over the top of this we have created a Particle Emitter. The `scale` value means the particles will start large and then scale away to nothing over the duration of their lifespan.
213+
Here we add a sky image into the game and create a Particle Emitter. The `scale` value means that the particles will initially be large and will shrink to nothing as their lifespan progresses.
212214

213-
Then we add the logo image. Notice how this is a Physics Image, which means it is given a physics body by default. We set some properties on it: velocity, bounce (or restitution) and collision with the world bounds. This will make our logo bounce around the screen. Finally, we tell the particle emitter to follow the logo - so as it moves, the particles will flow from it.
215+
After creating the `emitter`, we add a logo image called `logo`. Since `logo` is a Physics Image, `logo` is given a physics body by default. We set some properties for `logo`: velocity, bounce (or restitution), and collision with the world bounds. These properties will make our logo bounce around the screen. Finally, we tell the particle emitter to follow the logo - so as the logo moves, the particles will flow from it.
214216

215217
Run it in your browser and you'll see the following:
216218

217219
![Phaser 3 Demo](https://phaser.io/images/github/300/sample1.png "Phaser 3 Demo")
218220

219221
(Got an error? Here's the [full code](https://gist.github.com/photonstorm/46cb8fb4b19fc7717dcad514cdcec064))
220222

221-
It's just a tiny example, and we've hundreds more for you to explore, but hopefully it shows how expressive and quick Phaser is to use. With just a few easily readable lines of code we've got something pretty impressive up on screen!
223+
This is a tiny example, and there are hundreds more for you to explore, but hopefully it shows how expressive and quick Phaser is to use. With just a few easily readable lines of code, we've got something pretty impressive up on screen!
222224

223225
Subscribe to our weekly newsletter for further tutorials and examples.
224226

225227
![Building Phaser](https://phaser.io/images/github/div-building-phaser.png "Building Phaser")
226228

227-
Phaser is provided ready compiled in the `dist` folder of the repository. There are both plain and minified versions. The plain version is for use during development, and the minified version for production. You can also create your own builds.
229+
There are both plain and minified compiled versions of Phaser in the `dist` folder of the repository. The plain version is for use during development, and the minified version is for production use. You can also create your own builds.
228230

229231
### Custom Builds
230232

231-
Phaser 3 has to be built using Webpack. We take advantage of a number of Webpack features and plugins to allow us to properly tailor the build process. You can also elect exactly which features are bundled into your version of Phaser. We will release a tutorial covering the process shortly, but for now please look at our webpack config files to get an idea of the settings required.
233+
Phaser 3 must be built using Webpack. We take advantage of a number of Webpack features and plugins which allow us to properly tailor the build process. You can elect exactly which features are bundled into your version of Phaser. We will release a tutorial covering the process shortly, but for now please look at our webpack config files to get an idea of the required settings.
232234

233-
### Building from source
235+
### Building from Source
234236

235-
Should you wish to build Phaser 3 from source ensure you have the required packages by cloning the repository and then running `npm install`.
237+
If you wish to build Phaser 3 from source, ensure you have the required packages by cloning the repository and then running `npm install`.
236238

237-
You can then run `webpack` to perform a dev build to the `build` folder, including source maps for local testing, or run `npm run dist` to create a minified packaged build into the `dist` folder.
239+
You can then run `webpack` to create a development build in the `build` folder which includes source maps for local testing. You can also run `npm run dist` to create a minified packaged build in the `dist` folder.
238240

239241
![Change Log](https://phaser.io/images/github/div-change-log.png "Change Log")
240242
<a name="changelog"></a>

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"watch": "webpack --watch",
2020
"dist": "webpack --config webpack.dist.config.js",
2121
"lint": "eslint --config .eslintrc.json \"src/**/*.js\"",
22+
"lintfix": "eslint --config .eslintrc.json \"src/**/*.js\" --fix",
2223
"sloc": "node-sloc './src' --include-extensions \"js\""
2324
},
2425
"keywords": [

0 commit comments

Comments
 (0)