When I create a new cocos2dx project with the cocos new command there’s a flag named -e or `–engine-path, which sounds like it would allow me to specify a folder where the engine is located if I didn’t want the engine to be copied to the new project folder. However, using this flag doesn’t seem to do anything… or does it? Can someone please explain it for me?
Related to the above, I definitely don’t need a new copy of the engine everytime I create a new project, how can I tell Visual Studio (or, if there’s some file with configurable build paths) where the engine is located? I wish there was a way to put the engine in one place and use that all the time for every new project.
There’s stuff in the engine that you don’t always use when making a simple 2D game, like physics (box2d/chipmunk), 3D physics, etc. is there a simple way to create a new project that’s a little more lightweight and more focused on 2D graphics (with or without 2D physics)?
One way could be to use json-files with all the options and flags you want, and then give that as input to the cocos new command, like:
If you’re using Windows or Linux, refer to this guide.
Create your project as you normally would. Delete the cocos2d folder from your project, and then create a link named cocos2d in it’s place that points to where the cocos2d installation is. The specific type of link you want to use would be a symbolic link or junction link.
I mean, after unzipping cocos2dx3.xx, do I need to go into that folder and compile it before I can use it for other projects? I created a link as you advised (from a fresh project, after deleting the generated cocos2d folder), but got some kind of error (don’t remember what it was). After that, I unzipped cocos into a new folder, compiled it and pointed my link to the new folder, and then it worked. However, I can’t remember if I did something else besides that…
Ah windows. I see. Yes you need to do that at least once or when updating. I script it. They your symlinks to the libraries will all point to what you compiled. It works a bit different for each platform but I general the same concept applies.
I looked into that ccConfig.h file (didn’t know where it was located first) and it had some interesting settings in it, like CC_NODE_RENDER_SUBPIXEL and CC_USE_PHYSICS etc. but my concern with this file is its location. Its location is under cocos2d/cocos/base/ and if you want to create symlinks from multiple projects to this single cocos2d folder, the settings you want to make for one project might not be suitable for another project. This makes me wish I could use specialized ccConfig.h files when I needed to (per project). Is there a way to accomplish this?
Also, it’s safe to modify this file whenever you want during development, right?