Skip to content

Commit a481f75

Browse files
committed
Split up parent and gameObject defines so it's clearer and more useful
1 parent 7ed21b1 commit a481f75

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

v3/src/physics/impact/Body.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ var Body = new Class({
196196
// Can be overridden by user code
197197
collideWith: function (other, axis)
198198
{
199-
if (this.gameObject && this.gameObject._collideCallback)
199+
if (this.parent && this.parent._collideCallback)
200200
{
201-
this.gameObject._collideCallback.call(this.gameObject._callbackScope, this, other, axis);
201+
this.parent._collideCallback.call(this.parent._callbackScope, this, other, axis);
202202
}
203203
},
204204

v3/src/physics/impact/ImpactBody.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ var ImpactBody = new Class({
2424
{
2525
this.body = world.create(x, y, width, height);
2626

27+
this.body.parent = this;
28+
2729
// Local references to the Body properties
2830
this.size = this.body.size;
2931
this.offset = this.body.offset;

v3/src/physics/impact/ImpactImage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var ImpactImage = new Class({
2929

3030
this.body = world.create(x - this.frame.centerX, y - this.frame.centerY, this.width, this.height);
3131

32+
this.body.parent = this;
3233
this.body.gameObject = this;
3334

3435
// Local references to the Body properties

v3/src/physics/impact/ImpactSprite.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var ImpactSprite = new Class({
2929

3030
this.body = world.create(x - this.frame.centerX, y - this.frame.centerY, this.width, this.height);
3131

32+
this.body.parent = this;
3233
this.body.gameObject = this;
3334

3435
// Local references to the Body properties

0 commit comments

Comments
 (0)