Skip to content

Commit d8fee41

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents 53caac2 + 95ffa83 commit d8fee41

File tree

862 files changed

+728138
-274778
lines changed

Some content is hidden

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

862 files changed

+728138
-274778
lines changed

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
Thumbs.db
33
.DS_Store
44
.idea
5-
Phaser OSX.sublime-project
6-
Phaser OSX.sublime-workspace
7-
Phaser.sublime-project
8-
Phaser.sublime-workspace
95
*.suo
106
*.sublime-project
117
*.sublime-workspace
@@ -16,3 +12,4 @@ node_modules/
1612
# Build
1713
dist/
1814
/npm-debug.log
15+
out/

CHANGELOG.md

Lines changed: 215 additions & 0 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ make your changes and submit a Pull Request:
5151
- **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.
5252

5353

54+
##Coding style preferences are not contributions
55+
56+
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.
57+
58+
5459
##I don't really like git / node.js, but I can fix this bug
5560

5661
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.

Gruntfile.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = function (grunt) {
77
config: {
88
release_dir: 'build',
99
compile_dir: 'dist',
10+
docs_dir: 'docs',
1011
banner: require('fs').readFileSync(__dirname + '/tasks/banner.txt', 'utf8')
1112
}
1213
});
@@ -15,8 +16,10 @@ module.exports = function (grunt) {
1516

1617
grunt.registerTask('default', ['build']);
1718

18-
grunt.registerTask('build', ['clean', 'jshint', 'concat', 'uglify']);
19+
grunt.registerTask('build', ['clean:dist', 'jshint', 'concat', 'uglify']);
1920

20-
grunt.registerTask('dist', ['replace', 'build', 'copy']);
21+
grunt.registerTask('dist', ['replace:pixi', 'replace:p2', 'build', 'copy']);
22+
23+
grunt.registerTask('docs', [ 'clean:docs', 'pixidoc', 'builddoc', 'replace:docs', 'clean:out']);
2124

2225
};

README.md

Lines changed: 247 additions & 98 deletions
Large diffs are not rendered by default.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "phaser",
3-
"version": "2.1.3",
3+
"version": "2.2.0",
44
"homepage": "http://phaser.io",
55
"authors": [
66
"photonstorm <rich@photonstorm.com>"

build/config.php

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@
2424
$arcade = true;
2525
}
2626

27+
if (!isset($tilemap))
28+
{
29+
$tilemap = true;
30+
}
31+
32+
if (isset($nophysics))
33+
{
34+
$p2 = false;
35+
$box2d = false;
36+
$ninja = false;
37+
$arcade = false;
38+
$tilemap = false;
39+
}
40+
2741
if ($p2)
2842
{
2943
echo " <script src=\"$path/src/physics/p2/p2.js\"></script>";
@@ -36,9 +50,13 @@
3650

3751
echo <<<EOL
3852
53+
<script src="$path/src/polyfills.js"></script>
54+
3955
<script src="$path/src/pixi/Pixi.js"></script>
40-
<script src="$path/src/pixi/geom/Polygon.js"></script>
4156
<script src="$path/src/pixi/geom/Matrix.js"></script>
57+
<script src="$path/src/pixi/geom/Polygon.js"></script>
58+
<script src="$path/src/pixi/geom/Rectangle.js"></script>
59+
<script src="$path/src/pixi/geom/RoundedRectangle.js"></script>
4260
<script src="$path/src/pixi/display/DisplayObject.js"></script>
4361
<script src="$path/src/pixi/display/DisplayObjectContainer.js"></script>
4462
<script src="$path/src/pixi/display/Sprite.js"></script>
@@ -81,6 +99,7 @@
8199
<script src="$path/src/pixi/filters/AbstractFilter.js"></script>
82100
83101
<script src="$path/src/Phaser.js"></script>
102+
<script src="$path/src/polyfills.js"></script>
84103
<script src="$path/src/utils/Utils.js"></script>
85104
86105
<script src="$path/src/geom/Circle.js"></script>
@@ -95,8 +114,6 @@
95114
<script src="$path/src/core/Camera.js"></script>
96115
<script src="$path/src/core/State.js"></script>
97116
<script src="$path/src/core/StateManager.js"></script>
98-
<script src="$path/src/core/ArrayList.js"></script>
99-
<script src="$path/src/core/LinkedList.js"></script>
100117
<script src="$path/src/core/Signal.js"></script>
101118
<script src="$path/src/core/SignalBinding.js"></script>
102119
<script src="$path/src/core/Filter.js"></script>
@@ -105,10 +122,10 @@
105122
<script src="$path/src/core/Stage.js"></script>
106123
<script src="$path/src/core/Group.js"></script>
107124
<script src="$path/src/core/World.js"></script>
108-
<script src="$path/src/core/Game.js"></script>
109125
<script src="$path/src/core/FlexGrid.js"></script>
110126
<script src="$path/src/core/FlexLayer.js"></script>
111127
<script src="$path/src/core/ScaleManager.js"></script>
128+
<script src="$path/src/core/Game.js"></script>
112129
113130
<script src="$path/src/input/Input.js"></script>
114131
<script src="$path/src/input/Key.js"></script>
@@ -123,12 +140,13 @@
123140
<script src="$path/src/input/InputHandler.js"></script>
124141
125142
<script src="$path/src/gameobjects/Events.js"></script>
126-
<script src="$path/src/gameobjects/GameObjectCreator.js"></script>
127143
<script src="$path/src/gameobjects/GameObjectFactory.js"></script>
144+
<script src="$path/src/gameobjects/GameObjectCreator.js"></script>
128145
<script src="$path/src/gameobjects/BitmapData.js"></script>
129146
<script src="$path/src/gameobjects/Sprite.js"></script>
130147
<script src="$path/src/gameobjects/Image.js"></script>
131148
<script src="$path/src/gameobjects/TileSprite.js"></script>
149+
<script src="$path/src/gameobjects/Rope.js"></script>
132150
<script src="$path/src/gameobjects/Text.js"></script>
133151
<script src="$path/src/gameobjects/BitmapText.js"></script>
134152
<script src="$path/src/gameobjects/Button.js"></script>
@@ -137,10 +155,10 @@
137155
<script src="$path/src/gameobjects/SpriteBatch.js"></script>
138156
<script src="$path/src/gameobjects/RetroFont.js"></script>
139157
<script src="$path/src/gameobjects/Particle.js"></script>
140-
<script src="$path/src/gameobjects/Rope.js"></script>
141158
142-
<script src="$path/src/system/Canvas.js"></script>
143159
<script src="$path/src/system/Device.js"></script>
160+
<script src="$path/src/system/DOM.js"></script>
161+
<script src="$path/src/system/Canvas.js"></script>
144162
<script src="$path/src/system/RequestAnimationFrame.js"></script>
145163
146164
<script src="$path/src/math/Math.js"></script>
@@ -151,6 +169,7 @@
151169
152170
<script src="$path/src/tween/TweenManager.js"></script>
153171
<script src="$path/src/tween/Tween.js"></script>
172+
<script src="$path/src/tween/TweenData.js"></script>
154173
<script src="$path/src/tween/Easing.js"></script>
155174
156175
<script src="$path/src/time/Time.js"></script>
@@ -171,6 +190,9 @@
171190
<script src="$path/src/sound/Sound.js"></script>
172191
<script src="$path/src/sound/SoundManager.js"></script>
173192
193+
<script src="$path/src/utils/ArraySet.js"></script>
194+
<script src="$path/src/utils/LinkedList.js"></script>
195+
<script src="$path/src/utils/ArrayUtils.js"></script>
174196
<script src="$path/src/utils/Debug.js"></script>
175197
<script src="$path/src/utils/Color.js"></script>
176198
@@ -180,12 +202,20 @@
180202
<script src="$path/src/particles/arcade/ArcadeParticles.js"></script>
181203
<script src="$path/src/particles/arcade/Emitter.js"></script>
182204
205+
EOL;
206+
207+
if ($tilemap)
208+
{
209+
echo <<<EOL
210+
183211
<script src="$path/src/tilemap/Tile.js"></script>
184212
<script src="$path/src/tilemap/Tilemap.js"></script>
185213
<script src="$path/src/tilemap/TilemapLayer.js"></script>
186214
<script src="$path/src/tilemap/TilemapParser.js"></script>
187215
<script src="$path/src/tilemap/Tileset.js"></script>
216+
188217
EOL;
218+
}
189219

190220
if ($arcade)
191221
{
@@ -196,7 +226,6 @@
196226
EOL;
197227
}
198228

199-
200229
if ($p2)
201230
{
202231
echo <<<EOL

build/custom/ninja.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/p2.js

Lines changed: 80 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14290,7 +14290,7 @@ Phaser.Physics.P2.prototype = {
1429014290
*/
1429114291
update: function () {
1429214292

14293-
// Do nothing when the pysics engine was paused before
14293+
// Do nothing if the physics engine was paused before
1429414294
if (this.paused)
1429514295
{
1429614296
return;
@@ -14307,14 +14307,84 @@ Phaser.Physics.P2.prototype = {
1430714307

1430814308
},
1430914309

14310+
/**
14311+
* Called by Phaser.Physics when a State swap occurs.
14312+
* Starts the begin and end Contact listeners again.
14313+
*
14314+
* @method Phaser.Physics.P2#reset
14315+
*/
14316+
reset: function () {
14317+
14318+
this.world.on("beginContact", this.beginContactHandler, this);
14319+
this.world.on("endContact", this.endContactHandler, this);
14320+
14321+
this.nothingCollisionGroup = new Phaser.Physics.P2.CollisionGroup(1);
14322+
this.boundsCollisionGroup = new Phaser.Physics.P2.CollisionGroup(2);
14323+
this.everythingCollisionGroup = new Phaser.Physics.P2.CollisionGroup(2147483648);
14324+
14325+
this._collisionGroupID = 2;
14326+
14327+
this.setBoundsToWorld(true, true, true, true, false);
14328+
14329+
},
14330+
1431014331
/**
1431114332
* Clears all bodies from the simulation, resets callbacks and resets the collision bitmask.
14333+
*
14334+
* The P2 world is also cleared:
14335+
*
14336+
* * Removes all solver equations
14337+
* * Removes all constraints
14338+
* * Removes all bodies
14339+
* * Removes all springs
14340+
* * Removes all contact materials
14341+
*
14342+
* This is called automatically when you switch state.
1431214343
*
1431314344
* @method Phaser.Physics.P2#clear
1431414345
*/
1431514346
clear: function () {
1431614347

14317-
this.world.clear();
14348+
this.world.time = 0;
14349+
this.world.fixedStepTime = 0;
14350+
14351+
// Remove all solver equations
14352+
if (this.world.solver && this.world.solver.equations.length)
14353+
{
14354+
this.world.solver.removeAllEquations();
14355+
}
14356+
14357+
// Remove all constraints
14358+
var cs = this.world.constraints;
14359+
14360+
for (var i = cs.length - 1; i >= 0; i--)
14361+
{
14362+
this.world.removeConstraint(cs[i]);
14363+
}
14364+
14365+
// Remove all bodies
14366+
var bodies = this.world.bodies;
14367+
14368+
for (var i = bodies.length - 1; i >= 0; i--)
14369+
{
14370+
this.world.removeBody(bodies[i]);
14371+
}
14372+
14373+
// Remove all springs
14374+
var springs = this.world.springs;
14375+
14376+
for (var i = springs.length - 1; i >= 0; i--)
14377+
{
14378+
this.world.removeSpring(springs[i]);
14379+
}
14380+
14381+
// Remove all contact materials
14382+
var cms = this.world.contactMaterials;
14383+
14384+
for (var i = cms.length - 1; i >= 0; i--)
14385+
{
14386+
this.world.removeContactMaterial(cms[i]);
14387+
}
1431814388

1431914389
this.world.off("beginContact", this.beginContactHandler, this);
1432014390
this.world.off("endContact", this.endContactHandler, this);
@@ -14325,7 +14395,6 @@ Phaser.Physics.P2.prototype = {
1432514395

1432614396
this.collisionGroups = [];
1432714397
this._toRemove = [];
14328-
this._collisionGroupID = 2;
1432914398
this.boundsCollidesWith = [];
1433014399

1433114400
},
@@ -16622,6 +16691,11 @@ Phaser.Physics.P2.Body.prototype = {
1662216691
this.sprite.rotation = this.data.angle;
1662316692
}
1662416693

16694+
if (this.debugBody)
16695+
{
16696+
this.debugBody.updateSpriteTransform();
16697+
}
16698+
1662516699
},
1662616700

1662716701
/**
@@ -16714,7 +16788,7 @@ Phaser.Physics.P2.Body.prototype = {
1671416788

1671516789
if (this.debugBody)
1671616790
{
16717-
this.debugBody.destroy();
16791+
this.debugBody.destroy(true, true);
1671816792
}
1671916793

1672016794
this.debugBody = null;
@@ -17784,17 +17858,6 @@ Phaser.Physics.P2.BodyDebug.prototype.constructor = Phaser.Physics.P2.BodyDebug;
1778417858

1778517859
Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, {
1778617860

17787-
/**
17788-
* Core update.
17789-
*
17790-
* @method Phaser.Physics.P2.BodyDebug#update
17791-
*/
17792-
update: function() {
17793-
17794-
this.updateSpriteTransform();
17795-
17796-
},
17797-
1779817861
/**
1779917862
* Core update.
1780017863
*
@@ -17804,8 +17867,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, {
1780417867

1780517868
this.position.x = this.body.position[0] * this.ppu;
1780617869
this.position.y = this.body.position[1] * this.ppu;
17807-
17808-
return this.rotation = this.body.angle;
17870+
this.rotation = this.body.angle;
1780917871

1781017872
},
1781117873

@@ -17902,7 +17964,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, {
1790217964
if (typeof color === 'undefined') { color = 0xffffff; }
1790317965
g.lineStyle(lineWidth, 0x000000, 1);
1790417966
g.beginFill(color, 1.0);
17905-
g.drawCircle(x, y, -radius);
17967+
g.drawCircle(x, y, -radius*2);
1790617968
g.endFill();
1790717969
g.moveTo(x, y);
1790817970
g.lineTo(x + radius * Math.cos(-angle), y + radius * Math.sin(-angle));

build/custom/p2.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)