mirror of
https://github.com/wassname/phaser.git
synced 2026-08-07 11:26:10 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f0c764b63 | ||
|
|
375da5db14 | ||
|
|
159426c6fa | ||
|
|
a25f6dbc3b | ||
|
|
0ed1aedba7 | ||
|
|
bf8ee44d13 |
@@ -49,7 +49,7 @@ Phaser is everything we ever wanted from an HTML5 game framework. It powers all
|
||||
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!
|
||||
|
||||
@@ -67,7 +67,7 @@ There is also an [un-official Getting Started Guide](http://www.antonoffplus.com
|
||||
Change Log
|
||||
----------
|
||||
|
||||
Version 1.1.6 - "Shienar" - 24th February 2014
|
||||
Version 1.1.6 - "Shienar" - 24th February 2014 (amended 21:34 GMT)
|
||||
|
||||
New Examples:
|
||||
|
||||
@@ -82,6 +82,8 @@ Updates:
|
||||
|
||||
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)
|
||||
* 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)
|
||||
|
||||
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "phaser",
|
||||
"version": "1.1.5",
|
||||
"version": "1.1.6",
|
||||
"homepage": "http://phaser.io",
|
||||
"authors": [
|
||||
"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.",
|
||||
"main": "build/phaser.min.js",
|
||||
"main": "build/phaser.js",
|
||||
"keywords": [
|
||||
"html5",
|
||||
"game",
|
||||
|
||||
Vendored
+1
@@ -1267,6 +1267,7 @@ declare module Phaser {
|
||||
fileError(key: number): void;
|
||||
getAsset(type: string, key: string): any;
|
||||
image(key: string, url: string, overwrite?: boolean): Phaser.Loader;
|
||||
json(key: string, url: string): Phaser.Loader;
|
||||
jsonLoadComplete(index: number): void;
|
||||
removeAll(): void;
|
||||
removeFile(key: string, type: string): void;
|
||||
|
||||
+12
-6
@@ -18,7 +18,7 @@
|
||||
*
|
||||
* 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
|
||||
*
|
||||
@@ -41153,7 +41153,7 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
|
||||
if (this.rebound)
|
||||
{
|
||||
this.processRebound(body);
|
||||
this.processRebound(body, response.overlapN);
|
||||
this.reboundCheck(true, true, false);
|
||||
body.reboundCheck(true, true, false);
|
||||
}
|
||||
@@ -41174,7 +41174,7 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
|
||||
if (this.rebound)
|
||||
{
|
||||
this.processRebound(body);
|
||||
this.processRebound(body, response.overlapN);
|
||||
this.reboundCheck(true, true, false);
|
||||
body.reboundCheck(true, true, false);
|
||||
}
|
||||
@@ -41257,17 +41257,23 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
* @protected
|
||||
* @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
|
||||
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))
|
||||
{
|
||||
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);
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -15,15 +15,13 @@ function create() {
|
||||
|
||||
aliens = game.add.group();
|
||||
|
||||
game.physics.gravity.y = 100;
|
||||
|
||||
for (var i = 0; i < 50; i++)
|
||||
{
|
||||
var s = aliens.create(game.world.randomX, game.world.randomY, 'baddie');
|
||||
s.name = 'alien' + s;
|
||||
s.body.collideWorldBounds = true;
|
||||
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.velocity.setTo(10 + Math.random() * 40, 10 + Math.random() * 40);
|
||||
}
|
||||
@@ -32,10 +30,8 @@ function create() {
|
||||
car.name = 'car';
|
||||
car.anchor.setTo(0.5, 0.5);
|
||||
car.body.collideWorldBounds = true;
|
||||
// car.body.bounce.setTo(0.8, 0.8);
|
||||
car.body.allowRotation = true;
|
||||
// car.body.immovable = true;
|
||||
// car.body.minBounceVelocity = 0;
|
||||
car.body.immovable = true;
|
||||
|
||||
}
|
||||
|
||||
@@ -65,17 +61,4 @@ function update() {
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
@@ -652,7 +652,7 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
|
||||
if (this.rebound)
|
||||
{
|
||||
this.processRebound(body);
|
||||
this.processRebound(body, response.overlapN);
|
||||
this.reboundCheck(true, true, false);
|
||||
body.reboundCheck(true, true, false);
|
||||
}
|
||||
@@ -673,7 +673,7 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
|
||||
if (this.rebound)
|
||||
{
|
||||
this.processRebound(body);
|
||||
this.processRebound(body, response.overlapN);
|
||||
this.reboundCheck(true, true, false);
|
||||
body.reboundCheck(true, true, false);
|
||||
}
|
||||
@@ -756,17 +756,23 @@ Phaser.Physics.Arcade.Body.prototype = {
|
||||
* @protected
|
||||
* @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
|
||||
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))
|
||||
{
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user