6 Commits
Author SHA1 Message Date
Richard Davey 4f0c764b63 Merge pull request #484 from Strato/patch-1
Update phaser.d.ts
2014-02-26 01:25:38 +00:00
Strato 375da5db14 Update phaser.d.ts
Missing json() method on Phaser.Loader.
2014-02-25 19:03:30 +01:00
photonstorm 159426c6fa Updating bower for 1.1.6 + non-minified (#401). 2014-02-25 10:39:19 +00:00
photonstorm a25f6dbc3b Physics.processRebound now takes Body direction into account, helps with body-body collision bounces (thanks ram64)
Fixed the Example / physics / mass velocity test.
Fixed readme typo.
2014-02-24 21:43:02 +00:00
Richard Davey 0ed1aedba7 Merge pull request #477 from JoeAnzalone/master
Fix "ste-up" typo
2014-02-24 21:28:23 +00:00
Joe Anzalone bf8ee44d13 Fix "ste-up" typo 2014-02-24 11:08:18 -05:00
7 changed files with 33 additions and 35 deletions
+4 -2
View File
@@ -49,7 +49,7 @@ Phaser is everything we ever wanted from an HTML5 game framework. It powers all
Help Test 2.0 Help Test 2.0
------------- -------------
Originally we were going to release Phaser 1.2 next, however after working solidly on it for a while we realise it's such a large and API breaking/changing update that we need to ste-up the version to 2.0 to avoid any possible confusion. Progress has been rapid and we'd love for you to help test it. You'll notice a new [1.2 branch](https://github.com/photonstorm/phaser/tree/1.2) on github - we're going to keep the branch name as 1.2 as we're nearly at the end of development now, but please understand this is what will actually be the 2.0 release. Originally we were going to release Phaser 1.2 next, however after working solidly on it for a while we realise it's such a large and API breaking/changing update that we need to step-up the version to 2.0 to avoid any possible confusion. Progress has been rapid and we'd love for you to help test it. You'll notice a new [1.2 branch](https://github.com/photonstorm/phaser/tree/1.2) on github - we're going to keep the branch name as 1.2 as we're nearly at the end of development now, but please understand this is what will actually be the 2.0 release.
Please help test out 1.2/2.0 as much as you can. It features the brand new Pixi 1.5 internally as well as nearly complete integration with p2.js for all physics (dropping ArcadePhysics entirely). New versions are being pushed several times a day, so be sure to update and pull often. Don't expect to just run old games right under it yet, but please do check out the new tests, experiment and poke it around as much as you can - thank you! Please help test out 1.2/2.0 as much as you can. It features the brand new Pixi 1.5 internally as well as nearly complete integration with p2.js for all physics (dropping ArcadePhysics entirely). New versions are being pushed several times a day, so be sure to update and pull often. Don't expect to just run old games right under it yet, but please do check out the new tests, experiment and poke it around as much as you can - thank you!
@@ -67,7 +67,7 @@ There is also an [un-official Getting Started Guide](http://www.antonoffplus.com
Change Log Change Log
---------- ----------
Version 1.1.6 - "Shienar" - 24th February 2014 Version 1.1.6 - "Shienar" - 24th February 2014 (amended 21:34 GMT)
New Examples: New Examples:
@@ -82,6 +82,8 @@ Updates:
Bug Fixes: Bug Fixes:
* Physics.processRebound now takes Body direction into account, helps with body-body collision bounces (thanks ram64)
* Fixed the Example / physics / mass velocity test.
* Updated Physics.Body.applyDamping so that velocity is reduced down to zero properly (thanks caezs) * Updated Physics.Body.applyDamping so that velocity is reduced down to zero properly (thanks caezs)
* ArcadePhysics.collideSpriteVsTilemapLayer wouldn't call the process or collide callbacks if only 1 tile was involved in the check (thanks mandarinx) * ArcadePhysics.collideSpriteVsTilemapLayer wouldn't call the process or collide callbacks if only 1 tile was involved in the check (thanks mandarinx)
* Lots of documentation fixes (thanks nhowell) * Lots of documentation fixes (thanks nhowell)
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "phaser", "name": "phaser",
"version": "1.1.5", "version": "1.1.6",
"homepage": "http://phaser.io", "homepage": "http://phaser.io",
"authors": [ "authors": [
"photonstorm <rich@photonstorm.com>" "photonstorm <rich@photonstorm.com>"
], ],
"description": "A fun, free and fast 2D game framework for making HTML5 games for desktop and mobile, supporting Canvas and WebGL.", "description": "A fun, free and fast 2D game framework for making HTML5 games for desktop and mobile, supporting Canvas and WebGL.",
"main": "build/phaser.min.js", "main": "build/phaser.js",
"keywords": [ "keywords": [
"html5", "html5",
"game", "game",
+1
View File
@@ -1267,6 +1267,7 @@ declare module Phaser {
fileError(key: number): void; fileError(key: number): void;
getAsset(type: string, key: string): any; getAsset(type: string, key: string): any;
image(key: string, url: string, overwrite?: boolean): Phaser.Loader; image(key: string, url: string, overwrite?: boolean): Phaser.Loader;
json(key: string, url: string): Phaser.Loader;
jsonLoadComplete(index: number): void; jsonLoadComplete(index: number): void;
removeAll(): void; removeAll(): void;
removeFile(key: string, type: string): void; removeFile(key: string, type: string): void;
+12 -6
View File
@@ -18,7 +18,7 @@
* *
* Phaser - http://www.phaser.io * Phaser - http://www.phaser.io
* *
* v1.1.6 - Built at: Mon Feb 24 2014 01:27:13 * v1.1.6 - Built at: Mon Feb 24 2014 21:36:31
* *
* By Richard Davey http://www.photonstorm.com @photonstorm * By Richard Davey http://www.photonstorm.com @photonstorm
* *
@@ -41153,7 +41153,7 @@ Phaser.Physics.Arcade.Body.prototype = {
if (this.rebound) if (this.rebound)
{ {
this.processRebound(body); this.processRebound(body, response.overlapN);
this.reboundCheck(true, true, false); this.reboundCheck(true, true, false);
body.reboundCheck(true, true, false); body.reboundCheck(true, true, false);
} }
@@ -41174,7 +41174,7 @@ Phaser.Physics.Arcade.Body.prototype = {
if (this.rebound) if (this.rebound)
{ {
this.processRebound(body); this.processRebound(body, response.overlapN);
this.reboundCheck(true, true, false); this.reboundCheck(true, true, false);
body.reboundCheck(true, true, false); body.reboundCheck(true, true, false);
} }
@@ -41257,17 +41257,23 @@ Phaser.Physics.Arcade.Body.prototype = {
* @protected * @protected
* @param {Phaser.Physics.Arcade.Body} body - The Body that collided. * @param {Phaser.Physics.Arcade.Body} body - The Body that collided.
*/ */
processRebound: function (body) { processRebound: function (body, overlapN) {
// Don't rebound again if they've already rebounded in this frame // Don't rebound again if they've already rebounded in this frame
if (!(this._vx <= 0 && this.velocity.x > 0) && !(this._vx >= 0 && this.velocity.x < 0)) if (!(this._vx <= 0 && this.velocity.x > 0) && !(this._vx >= 0 && this.velocity.x < 0))
{ {
this.velocity.x = body.velocity.x - this.velocity.x * this.bounce.x; if (overlapN.x != 0)
{
this.velocity.x = body.velocity.x - this.velocity.x * this.bounce.x;
}
} }
if (!(this._vy <= 0 && this.velocity.y > 0) && !(this._vy >= 0 && this.velocity.y < 0)) if (!(this._vy <= 0 && this.velocity.y > 0) && !(this._vy >= 0 && this.velocity.y < 0))
{ {
this.velocity.y = body.velocity.y - this.velocity.y * this.bounce.y; if (overlapN.y != 0)
{
this.velocity.y = body.velocity.y - this.velocity.y * this.bounce.y;
}
} }
this.angle = Math.atan2(this.velocity.y, this.velocity.x); this.angle = Math.atan2(this.velocity.y, this.velocity.x);
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -19
View File
@@ -15,15 +15,13 @@ function create() {
aliens = game.add.group(); aliens = game.add.group();
game.physics.gravity.y = 100;
for (var i = 0; i < 50; i++) for (var i = 0; i < 50; i++)
{ {
var s = aliens.create(game.world.randomX, game.world.randomY, 'baddie'); var s = aliens.create(game.world.randomX, game.world.randomY, 'baddie');
s.name = 'alien' + s; s.name = 'alien' + s;
s.body.collideWorldBounds = true; s.body.collideWorldBounds = true;
s.body.bounce.setTo(0.8, 0.8); s.body.bounce.setTo(0.8, 0.8);
s.body.linearDamping = 0; s.body.linearDamping = 0.1;
s.body.minVelocity.setTo(0, 0); s.body.minVelocity.setTo(0, 0);
s.body.velocity.setTo(10 + Math.random() * 40, 10 + Math.random() * 40); s.body.velocity.setTo(10 + Math.random() * 40, 10 + Math.random() * 40);
} }
@@ -32,10 +30,8 @@ function create() {
car.name = 'car'; car.name = 'car';
car.anchor.setTo(0.5, 0.5); car.anchor.setTo(0.5, 0.5);
car.body.collideWorldBounds = true; car.body.collideWorldBounds = true;
// car.body.bounce.setTo(0.8, 0.8);
car.body.allowRotation = true; car.body.allowRotation = true;
// car.body.immovable = true; car.body.immovable = true;
// car.body.minBounceVelocity = 0;
} }
@@ -65,17 +61,4 @@ function update() {
function render() { function render() {
for (var i = 0; i < aliens._container.children.length; i++)
{
game.debug.renderPolygon(aliens._container.children[i].body.polygons);
}
game.debug.renderPolygon(car.body.polygons);
// game.debug.renderBodyInfo(aliens._container.children[0], 32, 32);
game.debug.renderBodyInfo(aliens._container.children[0], 32, 32);
// game.debug.renderBodyInfo(car, 16, 24);
// game.debug.renderBodyInfo(aliens.getFirstAlive(), 16, 24);
} }
+11 -5
View File
@@ -652,7 +652,7 @@ Phaser.Physics.Arcade.Body.prototype = {
if (this.rebound) if (this.rebound)
{ {
this.processRebound(body); this.processRebound(body, response.overlapN);
this.reboundCheck(true, true, false); this.reboundCheck(true, true, false);
body.reboundCheck(true, true, false); body.reboundCheck(true, true, false);
} }
@@ -673,7 +673,7 @@ Phaser.Physics.Arcade.Body.prototype = {
if (this.rebound) if (this.rebound)
{ {
this.processRebound(body); this.processRebound(body, response.overlapN);
this.reboundCheck(true, true, false); this.reboundCheck(true, true, false);
body.reboundCheck(true, true, false); body.reboundCheck(true, true, false);
} }
@@ -756,17 +756,23 @@ Phaser.Physics.Arcade.Body.prototype = {
* @protected * @protected
* @param {Phaser.Physics.Arcade.Body} body - The Body that collided. * @param {Phaser.Physics.Arcade.Body} body - The Body that collided.
*/ */
processRebound: function (body) { processRebound: function (body, overlapN) {
// Don't rebound again if they've already rebounded in this frame // Don't rebound again if they've already rebounded in this frame
if (!(this._vx <= 0 && this.velocity.x > 0) && !(this._vx >= 0 && this.velocity.x < 0)) if (!(this._vx <= 0 && this.velocity.x > 0) && !(this._vx >= 0 && this.velocity.x < 0))
{ {
this.velocity.x = body.velocity.x - this.velocity.x * this.bounce.x; if (overlapN.x != 0)
{
this.velocity.x = body.velocity.x - this.velocity.x * this.bounce.x;
}
} }
if (!(this._vy <= 0 && this.velocity.y > 0) && !(this._vy >= 0 && this.velocity.y < 0)) if (!(this._vy <= 0 && this.velocity.y > 0) && !(this._vy >= 0 && this.velocity.y < 0))
{ {
this.velocity.y = body.velocity.y - this.velocity.y * this.bounce.y; if (overlapN.y != 0)
{
this.velocity.y = body.velocity.y - this.velocity.y * this.bounce.y;
}
} }
this.angle = Math.atan2(this.velocity.y, this.velocity.x); this.angle = Math.atan2(this.velocity.y, this.velocity.x);