cc.Sprite.extend中添加chipnumk中的body,显示的时候有2个精灵,怎么解决

cc.Sprite.extend中添加chipnumk中的body,显示的时候有2个精灵,代码如下,另外,this.attr只修改了this这个精灵的大小,对cc.PhysicsSprite创建的那个没有作用。

var Player = cc.Sprite.extend({ ctor: function(space){
this._super(res.xxx_png);
this.space = space;
this.init();
},

init: function(){

//1. create PhysicsSprite with a sprite frame name
this.sprite = cc.PhysicsSprite(res.xxx_png);
var contentSize = this.sprite.getContentSize();
// 2. init the runner physic body
this.body = new cp.Body(1, cp.momentForBox(1, contentSize.width, contentSize.height));
//3. set the position of the runner
this.body.p = cc.p(this.startX, GG.groundHight + contentSize.height / 2);
//4. apply impulse to the body
//this.body.applyImpulse(cp.v(150, 0), cp.v(0, 0));//run speed
//5. add the created body to space
this.space.addBody(this.body);
//6. create the shape for the body
this.shape = new cp.BoxShape(this.body, contentSize.width - 14, contentSize.height);
//7. add shape to space
this.space.addShape(this.shape);
//8. set body to the physic sprite
this.sprite.setBody(this.body);

this.addChild(this.sprite);

//这里的this,就是精灵本身
this.attr({
anchorX: 0,
anchorY: 0,
x: 120,
y: 100,
scale: 0.5
});

}

顶一下:2::2:

解决了,把this._super(res.xxx_png);中的res.xxx_png去掉就好了。