cocos2d-html5
cocos2d-html5 copied to clipboard
3.13.1 PhysicsSprite can not add child bug
, ctor: function (node, space) {
this._super();
this.addChild(node);
this.space = space;
var radius = 40;
this.body = new cp.Body(1, cp.momentForCircle(1, 0, radius, cp.v(0, 0)));
// this.space.addBody(this.body);
this.shape = new cp.CircleShape(this.body, radius, cp.v(0, 0));
this.shape.setElasticity(0.5);
this.shape.setFriction(0.5);
this.shape.setCollisionType(ODDS_COLLISION_TYPE);
this.space.addShape(this.shape);
this.setBody(this.body);
this.body.data = this;
this.scheduleUpdate();
}
this cannot add child in this PhysicsSprite