Skip to content

Commit 8fc2a46

Browse files
committed
New Phaser package, small docs updates and preparing P2.World for new bounds code and v0.5.0 migration.
1 parent 451f68b commit 8fc2a46

12 files changed

Lines changed: 2728 additions & 2260 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
Phaser 2.0.3
44
============
55

6-
# Phaser 2.0.3 [![Build Status](https://travis-ci.org/photonstorm/phaser.png?branch=dev)](https://travis-ci.org/photonstorm/phaser)
7-
86
Phaser is a fast, free and fun open source game framework for making desktop and mobile browser HTML5 games. It uses [Pixi.js](https://github.com/GoodBoyDigital/pixi.js/) internally for fast 2D Canvas and WebGL rendering.
97

108
Version: 2.0.3 "Allorallen" - Released: -in development-
119

1210
By Richard Davey, [Photon Storm](http://www.photonstorm.com)
1311

12+
[![Build Status](https://travis-ci.org/photonstorm/phaser.png?branch=dev)](https://travis-ci.org/photonstorm/phaser)
13+
1414
* View the [Official Website](http://phaser.io)
1515
* Follow on [Twitter](https://twitter.com/photonstorm)
1616
* Join the [Forum](http://www.html5gamedevs.com/forum/14-phaser/)
@@ -78,6 +78,7 @@ Updated
7878
* If you pass `null` to Tilemap.putTile as the tile parameter it will pass the call over to Tilemap.removeTile.
7979
* TypeScript definitions updated for latest changes (thanks @clark-stevenson)
8080
* Keyboard.stop nulls the function references after removing the event listeners (thanks @bmceldowney, #691)
81+
* Tilemap.hasTile allows for multi-layer type parameter (thanks @Raeven0, #680)
8182

8283

8384
New Features

build/custom/phaser-no-libs.js

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* Phaser - http://phaser.io
99
*
10-
* v2.0.3 "Allorallen" - Built: Tue Apr 01 2014 19:51:08
10+
* v2.0.3 "Allorallen" - Built: Tue Apr 08 2014 03:28:03
1111
*
1212
* By Richard Davey http://www.photonstorm.com @photonstorm
1313
*
@@ -3570,7 +3570,7 @@ Phaser.State = function () {
35703570
this.stage = null;
35713571

35723572
/**
3573-
* @property {Phaser.TimeManager} time - Reference to game clock.
3573+
* @property {Phaser.Time} time - Reference to the core game clock.
35743574
*/
35753575
this.time = null;
35763576

@@ -3590,7 +3590,7 @@ Phaser.State = function () {
35903590
this.particles = null;
35913591

35923592
/**
3593-
* @property {Phaser.Physics.World} physics - Reference to the physics manager.
3593+
* @property {Phaser.Physics} physics - Reference to the physics manager.
35943594
*/
35953595
this.physics = null;
35963596

@@ -4251,7 +4251,8 @@ Phaser.StateManager.prototype = {
42514251
},
42524252

42534253
/**
4254-
* Nuke the entire game from orbit
4254+
* Removes all StateManager callback references to the State object, nulls the game reference and clears the States object.
4255+
* You don't recover from this without rebuilding the Phaser instance again.
42554256
* @method Phaser.StateManager#destroy
42564257
*/
42574258
destroy: function () {
@@ -6263,13 +6264,14 @@ Phaser.Group.prototype.updateZ = function () {
62636264
* Advances the Group cursor to the next object in the Group. If it's at the end of the Group it wraps around to the first object.
62646265
*
62656266
* @method Phaser.Group#next
6267+
* @return {*} The child the cursor now points to.
62666268
*/
62676269
Phaser.Group.prototype.next = function () {
62686270

62696271
if (this.cursor)
62706272
{
62716273
// Wrap the cursor?
6272-
if (this._cache[8] === this.children.length)
6274+
if (this._cache[8] >= this.children.length - 1)
62736275
{
62746276
this._cache[8] = 0;
62756277
}
@@ -6279,6 +6281,8 @@ Phaser.Group.prototype.next = function () {
62796281
}
62806282

62816283
this.cursor = this.children[this._cache[8]];
6284+
6285+
return this.cursor;
62826286
}
62836287

62846288
};
@@ -6287,6 +6291,7 @@ Phaser.Group.prototype.next = function () {
62876291
* Moves the Group cursor to the previous object in the Group. If it's at the start of the Group it wraps around to the last object.
62886292
*
62896293
* @method Phaser.Group#previous
6294+
* @return {*} The child the cursor now points to.
62906295
*/
62916296
Phaser.Group.prototype.previous = function () {
62926297

@@ -6303,6 +6308,8 @@ Phaser.Group.prototype.previous = function () {
63036308
}
63046309

63056310
this.cursor = this.children[this._cache[8]];
6311+
6312+
return this.cursor;
63066313
}
63076314

63086315
};
@@ -6382,7 +6389,7 @@ Phaser.Group.prototype.moveUp = function (child) {
63826389

63836390
if (b)
63846391
{
6385-
this.swap(a, b);
6392+
this.swap(child, b);
63866393
}
63876394
}
63886395

@@ -6406,7 +6413,7 @@ Phaser.Group.prototype.moveDown = function (child) {
64066413

64076414
if (b)
64086415
{
6409-
this.swap(a, b);
6416+
this.swap(child, b);
64106417
}
64116418
}
64126419

@@ -8564,7 +8571,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
85648571
this.physicsConfig = physicsConfig;
85658572

85668573
/**
8567-
* @property {HTMLElement} parent - The Games DOM parent.
8574+
* @property {string|HTMLElement} parent - The Games DOM parent.
85688575
* @default
85698576
*/
85708577
this.parent = '';
@@ -8594,18 +8601,17 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
85948601
this.antialias = true;
85958602

85968603
/**
8597-
* @property {number} renderer - The Pixi Renderer
8598-
* @default
8604+
* @property {PIXI.CanvasRenderer|PIXI.WebGLRenderer} renderer - The Pixi Renderer.
85998605
*/
8600-
this.renderer = Phaser.AUTO;
8606+
this.renderer = null;
86018607

86028608
/**
86038609
* @property {number} renderType - The Renderer this game will use. Either Phaser.AUTO, Phaser.CANVAS or Phaser.WEBGL.
86048610
*/
86058611
this.renderType = Phaser.AUTO;
86068612

86078613
/**
8608-
* @property {number} state - The StateManager.
8614+
* @property {Phaser.StateManager} state - The StateManager.
86098615
*/
86108616
this.state = null;
86118617

@@ -8638,19 +8644,16 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
86388644

86398645
/**
86408646
* @property {Phaser.Cache} cache - Reference to the assets cache.
8641-
* @default
86428647
*/
86438648
this.cache = null;
86448649

86458650
/**
86468651
* @property {Phaser.Input} input - Reference to the input manager
8647-
* @default
86488652
*/
86498653
this.input = null;
86508654

86518655
/**
86528656
* @property {Phaser.Loader} load - Reference to the assets loader.
8653-
* @default
86548657
*/
86558658
this.load = null;
86568659

@@ -8680,7 +8683,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
86808683
this.stage = null;
86818684

86828685
/**
8683-
* @property {Phaser.TimeManager} time - Reference to game clock.
8686+
* @property {Phaser.Time} time - Reference to the core game clock.
86848687
*/
86858688
this.time = null;
86868689

@@ -8710,7 +8713,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
87108713
this.device = null;
87118714

87128715
/**
8713-
* @property {Phaser.Physics.PhysicsManager} camera - A handy reference to world.camera.
8716+
* @property {Phaser.Camera} camera - A handy reference to world.camera.
87148717
*/
87158718
this.camera = null;
87168719

@@ -8742,7 +8745,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
87428745
this.stepping = false;
87438746

87448747
/**
8745-
* @property {boolean} stepping - An internal property used by enableStep, but also useful to query from your own game objects.
8748+
* @property {boolean} pendingStep - An internal property used by enableStep, but also useful to query from your own game objects.
87468749
* @default
87478750
* @readonly
87488751
*/
@@ -8778,14 +8781,12 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
87788781
/**
87798782
* @property {boolean} _paused - Is game paused?
87808783
* @private
8781-
* @default
87828784
*/
87838785
this._paused = false;
87848786

87858787
/**
87868788
* @property {boolean} _codePaused - Was the game paused via code or a visibility change?
87878789
* @private
8788-
* @default
87898790
*/
87908791
this._codePaused = false;
87918792

@@ -10681,12 +10682,12 @@ Phaser.Keyboard.prototype = {
1068110682
*/
1068210683
stop: function () {
1068310684

10684-
this._onKeyDown = null;
10685-
this._onKeyUp = null;
10686-
1068710685
window.removeEventListener('keydown', this._onKeyDown);
1068810686
window.removeEventListener('keyup', this._onKeyUp);
1068910687

10688+
this._onKeyDown = null;
10689+
this._onKeyUp = null;
10690+
1069010691
},
1069110692

1069210693
/**
@@ -11755,7 +11756,7 @@ Phaser.Pointer.prototype = {
1175511756
this.button = event.button;
1175611757
}
1175711758

11758-
this._history.length = 0;
11759+
this._history = [];
1175911760
this.active = true;
1176011761
this.withinGame = true;
1176111762
this.isDown = true;
@@ -16761,10 +16762,10 @@ Phaser.Sprite.prototype.preUpdate = function() {
1676116762
}
1676216763

1676316764
// Update any Children
16764-
for (var i = 0, len = this.children.length; i < len; i++)
16765-
{
16766-
this.children[i].preUpdate();
16767-
}
16765+
// for (var i = 0, len = this.children.length; i < len; i++)
16766+
// {
16767+
// this.children[i].preUpdate();
16768+
// }
1676816769

1676916770
return true;
1677016771

@@ -31040,7 +31041,7 @@ Phaser.Loader = function (game) {
3104031041
this.preloadSprite = null;
3104131042

3104231043
/**
31043-
* @property {boolean|string} crossOrigin - The crossOrigin value applied to loaded images.
31044+
* @property {boolean|string} crossOrigin - The crossOrigin value applied to loaded images. Very often this needs to be set to 'anonymous'.
3104431045
* @default
3104531046
*/
3104631047
this.crossOrigin = false;
@@ -33515,7 +33516,7 @@ Phaser.SoundManager.prototype = {
3351533516
this.context = null;
3351633517
this.usingWebAudio = false;
3351733518
this.noAudio = true;
33518-
}
33519+
}
3351933520
}
3352033521
else if (!!window['webkitAudioContext'])
3352133522
{
@@ -39875,6 +39876,8 @@ Phaser.Tilemap.prototype = {
3987539876
*/
3987639877
hasTile: function (x, y, layer) {
3987739878

39879+
layer = this.getLayer(layer);
39880+
3987839881
return (this.layers[layer].data[y] !== null && this.layers[layer].data[y][x] !== null);
3987939882

3988039883
},

build/custom/phaser-no-libs.min.js

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

0 commit comments

Comments
 (0)