Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Dec 3, 2014
2 parents 53caac2 + 95ffa83 commit d8fee41
Show file tree
Hide file tree
Showing 862 changed files with 728,138 additions and 274,778 deletions.
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
Thumbs.db
.DS_Store
.idea
Phaser OSX.sublime-project
Phaser OSX.sublime-workspace
Phaser.sublime-project
Phaser.sublime-workspace
*.suo
*.sublime-project
*.sublime-workspace
Expand All @@ -16,3 +12,4 @@ node_modules/
# Build
dist/
/npm-debug.log
out/
215 changes: 215 additions & 0 deletions CHANGELOG.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ make your changes and submit a Pull Request:
- **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.


##Coding style preferences are not contributions

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.


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

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.
Expand Down
7 changes: 5 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = function (grunt) {
config: {
release_dir: 'build',
compile_dir: 'dist',
docs_dir: 'docs',
banner: require('fs').readFileSync(__dirname + '/tasks/banner.txt', 'utf8')
}
});
Expand All @@ -15,8 +16,10 @@ module.exports = function (grunt) {

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

grunt.registerTask('build', ['clean', 'jshint', 'concat', 'uglify']);
grunt.registerTask('build', ['clean:dist', 'jshint', 'concat', 'uglify']);

grunt.registerTask('dist', ['replace', 'build', 'copy']);
grunt.registerTask('dist', ['replace:pixi', 'replace:p2', 'build', 'copy']);

grunt.registerTask('docs', [ 'clean:docs', 'pixidoc', 'builddoc', 'replace:docs', 'clean:out']);

};
345 changes: 247 additions & 98 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phaser",
"version": "2.1.3",
"version": "2.2.0",
"homepage": "http://phaser.io",
"authors": [
"photonstorm <[email protected]>"
Expand Down
45 changes: 37 additions & 8 deletions build/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@
$arcade = true;
}

if (!isset($tilemap))
{
$tilemap = true;
}

if (isset($nophysics))
{
$p2 = false;
$box2d = false;
$ninja = false;
$arcade = false;
$tilemap = false;
}

if ($p2)
{
echo " <script src=\"$path/src/physics/p2/p2.js\"></script>";
Expand All @@ -36,9 +50,13 @@

echo <<<EOL
<script src="$path/src/polyfills.js"></script>
<script src="$path/src/pixi/Pixi.js"></script>
<script src="$path/src/pixi/geom/Polygon.js"></script>
<script src="$path/src/pixi/geom/Matrix.js"></script>
<script src="$path/src/pixi/geom/Polygon.js"></script>
<script src="$path/src/pixi/geom/Rectangle.js"></script>
<script src="$path/src/pixi/geom/RoundedRectangle.js"></script>
<script src="$path/src/pixi/display/DisplayObject.js"></script>
<script src="$path/src/pixi/display/DisplayObjectContainer.js"></script>
<script src="$path/src/pixi/display/Sprite.js"></script>
Expand Down Expand Up @@ -81,6 +99,7 @@
<script src="$path/src/pixi/filters/AbstractFilter.js"></script>
<script src="$path/src/Phaser.js"></script>
<script src="$path/src/polyfills.js"></script>
<script src="$path/src/utils/Utils.js"></script>
<script src="$path/src/geom/Circle.js"></script>
Expand All @@ -95,8 +114,6 @@
<script src="$path/src/core/Camera.js"></script>
<script src="$path/src/core/State.js"></script>
<script src="$path/src/core/StateManager.js"></script>
<script src="$path/src/core/ArrayList.js"></script>
<script src="$path/src/core/LinkedList.js"></script>
<script src="$path/src/core/Signal.js"></script>
<script src="$path/src/core/SignalBinding.js"></script>
<script src="$path/src/core/Filter.js"></script>
Expand All @@ -105,10 +122,10 @@
<script src="$path/src/core/Stage.js"></script>
<script src="$path/src/core/Group.js"></script>
<script src="$path/src/core/World.js"></script>
<script src="$path/src/core/Game.js"></script>
<script src="$path/src/core/FlexGrid.js"></script>
<script src="$path/src/core/FlexLayer.js"></script>
<script src="$path/src/core/ScaleManager.js"></script>
<script src="$path/src/core/Game.js"></script>
<script src="$path/src/input/Input.js"></script>
<script src="$path/src/input/Key.js"></script>
Expand All @@ -123,12 +140,13 @@
<script src="$path/src/input/InputHandler.js"></script>
<script src="$path/src/gameobjects/Events.js"></script>
<script src="$path/src/gameobjects/GameObjectCreator.js"></script>
<script src="$path/src/gameobjects/GameObjectFactory.js"></script>
<script src="$path/src/gameobjects/GameObjectCreator.js"></script>
<script src="$path/src/gameobjects/BitmapData.js"></script>
<script src="$path/src/gameobjects/Sprite.js"></script>
<script src="$path/src/gameobjects/Image.js"></script>
<script src="$path/src/gameobjects/TileSprite.js"></script>
<script src="$path/src/gameobjects/Rope.js"></script>
<script src="$path/src/gameobjects/Text.js"></script>
<script src="$path/src/gameobjects/BitmapText.js"></script>
<script src="$path/src/gameobjects/Button.js"></script>
Expand All @@ -137,10 +155,10 @@
<script src="$path/src/gameobjects/SpriteBatch.js"></script>
<script src="$path/src/gameobjects/RetroFont.js"></script>
<script src="$path/src/gameobjects/Particle.js"></script>
<script src="$path/src/gameobjects/Rope.js"></script>
<script src="$path/src/system/Canvas.js"></script>
<script src="$path/src/system/Device.js"></script>
<script src="$path/src/system/DOM.js"></script>
<script src="$path/src/system/Canvas.js"></script>
<script src="$path/src/system/RequestAnimationFrame.js"></script>
<script src="$path/src/math/Math.js"></script>
Expand All @@ -151,6 +169,7 @@
<script src="$path/src/tween/TweenManager.js"></script>
<script src="$path/src/tween/Tween.js"></script>
<script src="$path/src/tween/TweenData.js"></script>
<script src="$path/src/tween/Easing.js"></script>
<script src="$path/src/time/Time.js"></script>
Expand All @@ -171,6 +190,9 @@
<script src="$path/src/sound/Sound.js"></script>
<script src="$path/src/sound/SoundManager.js"></script>
<script src="$path/src/utils/ArraySet.js"></script>
<script src="$path/src/utils/LinkedList.js"></script>
<script src="$path/src/utils/ArrayUtils.js"></script>
<script src="$path/src/utils/Debug.js"></script>
<script src="$path/src/utils/Color.js"></script>
Expand All @@ -180,12 +202,20 @@
<script src="$path/src/particles/arcade/ArcadeParticles.js"></script>
<script src="$path/src/particles/arcade/Emitter.js"></script>
EOL;

if ($tilemap)
{
echo <<<EOL
<script src="$path/src/tilemap/Tile.js"></script>
<script src="$path/src/tilemap/Tilemap.js"></script>
<script src="$path/src/tilemap/TilemapLayer.js"></script>
<script src="$path/src/tilemap/TilemapParser.js"></script>
<script src="$path/src/tilemap/Tileset.js"></script>
EOL;
}

if ($arcade)
{
Expand All @@ -196,7 +226,6 @@
EOL;
}


if ($p2)
{
echo <<<EOL
Expand Down
2 changes: 1 addition & 1 deletion build/custom/ninja.min.js

Large diffs are not rendered by default.

98 changes: 80 additions & 18 deletions build/custom/p2.js
Original file line number Diff line number Diff line change
Expand Up @@ -14290,7 +14290,7 @@ Phaser.Physics.P2.prototype = {
*/
update: function () {

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

},

/**
* Called by Phaser.Physics when a State swap occurs.
* Starts the begin and end Contact listeners again.
*
* @method Phaser.Physics.P2#reset
*/
reset: function () {

this.world.on("beginContact", this.beginContactHandler, this);
this.world.on("endContact", this.endContactHandler, this);

this.nothingCollisionGroup = new Phaser.Physics.P2.CollisionGroup(1);
this.boundsCollisionGroup = new Phaser.Physics.P2.CollisionGroup(2);
this.everythingCollisionGroup = new Phaser.Physics.P2.CollisionGroup(2147483648);

this._collisionGroupID = 2;

this.setBoundsToWorld(true, true, true, true, false);

},

/**
* Clears all bodies from the simulation, resets callbacks and resets the collision bitmask.
*
* The P2 world is also cleared:
*
* * Removes all solver equations
* * Removes all constraints
* * Removes all bodies
* * Removes all springs
* * Removes all contact materials
*
* This is called automatically when you switch state.
*
* @method Phaser.Physics.P2#clear
*/
clear: function () {

this.world.clear();
this.world.time = 0;
this.world.fixedStepTime = 0;

// Remove all solver equations
if (this.world.solver && this.world.solver.equations.length)
{
this.world.solver.removeAllEquations();
}

// Remove all constraints
var cs = this.world.constraints;

for (var i = cs.length - 1; i >= 0; i--)
{
this.world.removeConstraint(cs[i]);
}

// Remove all bodies
var bodies = this.world.bodies;

for (var i = bodies.length - 1; i >= 0; i--)
{
this.world.removeBody(bodies[i]);
}

// Remove all springs
var springs = this.world.springs;

for (var i = springs.length - 1; i >= 0; i--)
{
this.world.removeSpring(springs[i]);
}

// Remove all contact materials
var cms = this.world.contactMaterials;

for (var i = cms.length - 1; i >= 0; i--)
{
this.world.removeContactMaterial(cms[i]);
}

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

this.collisionGroups = [];
this._toRemove = [];
this._collisionGroupID = 2;
this.boundsCollidesWith = [];

},
Expand Down Expand Up @@ -16622,6 +16691,11 @@ Phaser.Physics.P2.Body.prototype = {
this.sprite.rotation = this.data.angle;
}

if (this.debugBody)
{
this.debugBody.updateSpriteTransform();
}

},

/**
Expand Down Expand Up @@ -16714,7 +16788,7 @@ Phaser.Physics.P2.Body.prototype = {

if (this.debugBody)
{
this.debugBody.destroy();
this.debugBody.destroy(true, true);
}

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

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

/**
* Core update.
*
* @method Phaser.Physics.P2.BodyDebug#update
*/
update: function() {

this.updateSpriteTransform();

},

/**
* Core update.
*
Expand All @@ -17804,8 +17867,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, {

this.position.x = this.body.position[0] * this.ppu;
this.position.y = this.body.position[1] * this.ppu;

return this.rotation = this.body.angle;
this.rotation = this.body.angle;

},

Expand Down Expand Up @@ -17902,7 +17964,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, {
if (typeof color === 'undefined') { color = 0xffffff; }
g.lineStyle(lineWidth, 0x000000, 1);
g.beginFill(color, 1.0);
g.drawCircle(x, y, -radius);
g.drawCircle(x, y, -radius*2);
g.endFill();
g.moveTo(x, y);
g.lineTo(x + radius * Math.cos(-angle), y + radius * Math.sin(-angle));
Expand Down
6 changes: 3 additions & 3 deletions build/custom/p2.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit d8fee41

Please sign in to comment.