Skip to content

Commit 3020e3b

Browse files
committed
Updating core objects.
1 parent d8adad4 commit 3020e3b

3 files changed

Lines changed: 82 additions & 7 deletions

File tree

src/gameobjects/BaseGameObject.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2016 Photon Storm Ltd.
4+
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5+
*/
6+
7+
Phaser.GameObject = function (game)
8+
{
9+
this.game = game;
10+
11+
this.name = '';
12+
13+
this.parent = null;
14+
15+
this.children = null;
16+
17+
this.transform = null;
18+
};
19+
20+
Phaser.GameObject.prototype.constructor = Phaser.GameObject;
21+
22+
Phaser.GameObject.prototype = {
23+
24+
preUpdate: function ()
25+
{
26+
// NOOP
27+
},
28+
29+
update: function ()
30+
{
31+
// NOOP
32+
},
33+
34+
postUpdate: function ()
35+
{
36+
// NOOP
37+
},
38+
39+
render: function ()
40+
{
41+
// NOOP
42+
}
43+
44+
};

src/gameobjects/GameObject.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,37 @@ Phaser.GameObject = function (game)
88
{
99
this.game = game;
1010

11+
this.name = '';
12+
13+
this.parent = null;
14+
1115
this.children = null;
1216

1317
this.transform = null;
18+
};
19+
20+
Phaser.GameObject.prototype.constructor = Phaser.GameObject;
21+
22+
Phaser.GameObject.prototype = {
23+
24+
preUpdate: function ()
25+
{
26+
// NOOP
27+
},
28+
29+
update: function ()
30+
{
31+
// NOOP
32+
},
33+
34+
postUpdate: function ()
35+
{
36+
// NOOP
37+
},
38+
39+
render: function ()
40+
{
41+
// NOOP
42+
}
1443

1544
};

src/gameobjects/sprite/Sprite.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ Phaser.GameObject.Sprite = function (game, x, y, key, frame)
5555

5656
this.data = new Phaser.Component.Data(this);
5757

58+
this.color = new Phaser.Component.Color(this);
59+
5860
// Temporary for now?
59-
this.alpha = 1;
60-
this.worldAlpha = 1;
61-
this.blendMode = Phaser.blendModes.NORMAL;
61+
// this.alpha = 1;
62+
// this.worldAlpha = 1;
63+
// this.blendMode = Phaser.blendModes.NORMAL;
6264
this.scaleMode = Phaser.scaleModes.DEFAULT;
6365
this.exists = true;
6466
};
@@ -74,10 +76,10 @@ Phaser.GameObject.Sprite.prototype.constructor = Phaser.GameObject.Sprite;
7476
*/
7577
Phaser.GameObject.Sprite.prototype.preUpdate = function ()
7678
{
77-
if (this.parent)
78-
{
79-
this.worldAlpha = this.alpha * this.parent.worldAlpha;
80-
}
79+
// if (this.parent)
80+
// {
81+
// this.worldAlpha = this.alpha * this.parent.worldAlpha;
82+
// }
8183

8284
this.children.preUpdate();
8385
};

0 commit comments

Comments
 (0)