初学者的疑问

好多的书籍都是webStorm+cocos2d-x来写的.
但是按书上写的总是出现莫名奇妙的错误.

代码如下
main.js

//load resources
cc.LoaderScene.preload(g_resources, function () {
cc.director.runScene(new HelloWorldScene());
}, this);

app.js

var HelloWorldScene = cc.Scene.extend({
onEnter:function () {
this._super();
var layer = new BackGroundLayer();
this.addChild(layer);
}
});

Background.js

var BackGroundLayer = cc.Layer.extend({
ctor : function() {
this._super();
var size = cc.winSize;

    var sprite1 = new cc.sprite(res.HelloWorld_png);
    sprite1.attr({
        x : size.width / 2,
        y : size.height / 2
    });
    this.addChild(sprite1);
    return true;
}

});

感觉要崩溃了!

初学者,还是js的,不都去学 creator 了吗

买了本凌建峰老师的书, 结果呵呵了

现在更新很快,买的书可以参考那种逻辑和思路,具体接口还是得查 API

嗯嗯, 谢谢了