Skip to content

Commit 85c8f60

Browse files
committed
Removed 'global' component arrays.
1 parent 3db4313 commit 85c8f60

5 files changed

Lines changed: 13 additions & 21 deletions

File tree

src/gameobjects/Graphics.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Phaser.Graphics = function (game, x, y) {
5151
Phaser.Graphics.prototype = Object.create(PIXI.Graphics.prototype);
5252
Phaser.Graphics.prototype.constructor = Phaser.Graphics;
5353

54-
var components = [
54+
Phaser.Component.Core.install.call(Phaser.Graphics.prototype, [
5555
'Angle',
5656
'AutoCull',
5757
'Bounds',
@@ -62,9 +62,7 @@ var components = [
6262
'LifeSpan',
6363
'PhysicsBody',
6464
'Reset'
65-
];
66-
67-
Phaser.Component.Core.install.call(Phaser.Graphics.prototype, components);
65+
]);
6866

6967
Phaser.Graphics.prototype.preUpdatePhysics = Phaser.Component.PhysicsBody.preUpdate;
7068
Phaser.Graphics.prototype.preUpdateLifeSpan = Phaser.Component.LifeSpan.preUpdate;
@@ -73,7 +71,9 @@ Phaser.Graphics.prototype.preUpdateCore = Phaser.Component.Core.preUpdate;
7371

7472
/**
7573
* Automatically called by World.preUpdate.
76-
* @method Phaser.Graphics.prototype.preUpdate
74+
*
75+
* @method
76+
* @memberof Phaser.Graphics
7777
*/
7878
Phaser.Graphics.prototype.preUpdate = function () {
7979

src/gameobjects/Image.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Phaser.Image = function (game, x, y, key, frame) {
5454
Phaser.Image.prototype = Object.create(PIXI.Sprite.prototype);
5555
Phaser.Image.prototype.constructor = Phaser.Image;
5656

57-
var components = [
57+
Phaser.Component.Core.install.call(Phaser.Image.prototype, [
5858
'Angle',
5959
'Animation',
6060
'AutoCull',
@@ -69,9 +69,7 @@ var components = [
6969
'Overlap',
7070
'Reset',
7171
'Smoothed'
72-
];
73-
74-
Phaser.Component.Core.install.call(Phaser.Image.prototype, components);
72+
]);
7573

7674
Phaser.Image.prototype.preUpdateInWorld = Phaser.Component.InWorld.preUpdate;
7775
Phaser.Image.prototype.preUpdateCore = Phaser.Component.Core.preUpdate;

src/gameobjects/Rope.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Phaser.Rope = function (game, x, y, key, frame, points) {
7070
Phaser.Rope.prototype = Object.create(PIXI.Rope.prototype);
7171
Phaser.Rope.prototype.constructor = Phaser.Rope;
7272

73-
var components = [
73+
Phaser.Component.Core.install.call(Phaser.Rope.prototype, [
7474
'Angle',
7575
'Animation',
7676
'AutoCull',
@@ -89,9 +89,7 @@ var components = [
8989
'Reset',
9090
'ScaleMinMax',
9191
'Smoothed'
92-
];
93-
94-
Phaser.Component.Core.install.call(Phaser.Rope.prototype, components);
92+
]);
9593

9694
Phaser.Rope.prototype.preUpdatePhysics = Phaser.Component.PhysicsBody.preUpdate;
9795
Phaser.Rope.prototype.preUpdateLifeSpan = Phaser.Component.LifeSpan.preUpdate;

src/gameobjects/Text.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Phaser.Text = function (game, x, y, text, style) {
115115
Phaser.Text.prototype = Object.create(PIXI.Text.prototype);
116116
Phaser.Text.prototype.constructor = Phaser.Text;
117117

118-
var components = [
118+
Phaser.Component.Core.install.call(Phaser.Text.prototype, [
119119
'Angle',
120120
'AutoCull',
121121
'Bounds',
@@ -129,9 +129,7 @@ var components = [
129129
'PhysicsBody',
130130
'Reset',
131131
'Smoothed'
132-
];
133-
134-
Phaser.Component.Core.install.call(Phaser.Text.prototype, components);
132+
]);
135133

136134
Phaser.Text.prototype.preUpdatePhysics = Phaser.Component.PhysicsBody.preUpdate;
137135
Phaser.Text.prototype.preUpdateLifeSpan = Phaser.Component.LifeSpan.preUpdate;

src/gameobjects/TileSprite.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Phaser.TileSprite = function (game, x, y, width, height, key, frame) {
6363
Phaser.TileSprite.prototype = Object.create(PIXI.TilingSprite.prototype);
6464
Phaser.TileSprite.prototype.constructor = Phaser.TileSprite;
6565

66-
var components = [
66+
Phaser.Component.Core.install.call(Phaser.TileSprite.prototype, [
6767
'Angle',
6868
'Animation',
6969
'AutoCull',
@@ -77,9 +77,7 @@ var components = [
7777
'PhysicsBody',
7878
'Reset',
7979
'Smoothed'
80-
];
81-
82-
Phaser.Component.Core.install.call(Phaser.TileSprite.prototype, components);
80+
]);
8381

8482
Phaser.TileSprite.prototype.preUpdatePhysics = Phaser.Component.PhysicsBody.preUpdate;
8583
Phaser.TileSprite.prototype.preUpdateLifeSpan = Phaser.Component.LifeSpan.preUpdate;

0 commit comments

Comments
 (0)