Since it's a basic game with no physics, we don't need to include external libraries; so, project.json
returns to its original content:
{ "debugMode" : 0, "showFPS" : false, "frameRate" : 60, "id" : "gameCanvas", "renderMode" : 0, "engineDir":"cocos2d-html5/", "modules" : ["cocos2d"], "jsList" : [ "src/loadassets.js", "src/gamescript.js" ] }
Also, the content of main.js
is basically the same as always:
cc.game.onStart = function(){
var screenSize = cc.view.getFrameSize();
cc.view.setDesignResolutionSize(300, 300, cc.ResolutionPolicy.SHOW_ALL);
cc.LoaderScene.preload(gameResources, function () {
cc.director.runScene(new gameScene());
}, this);
};
cc.game.run();
Just have a look at the resolution: 300x300 is the main game area. For now, we'll only focus on the main game area, and believe me, you'll have enough to do!
loadassets.js
is loading a sprite sheet created with
TexturePacker:
var gameResources = [ "assets/globes.png", "assets/globes...