我是新手,按着教程来做,做到星星的那一步时,发出星星的坐标不对,之后逐步查,发出得不到屏幕的宽~求助!
getNewStarPosition:function(){
var randX = 0;
var randY = this.groundY+cc.random0To1()*this.player.getComponent(‘Player’).jumpHeight +200;
var maxX = this.node.width/2;
randX = cc.randomMinus1To1() * maxX;
console.log(randX+" & "+randY);
console.log(this.node.width);
return cc.p(randX,randY);
this.node.width 这一句输出为0