The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
This is no longer supported. You probably want https://github.com/cocos2d/cocos2d-js instead.
If you really do want to run multiple versions on the same machine you will have to do a manual install and launch the appropriate 'cocos' command directly.
To upgrade your project from v0.1 you should create a new project using the 'cocos' command and then copy the src folder from your old project into the new one. There may be backwards incompatibilities which you'll need to debug.
Follow the instructions for your given platform or skip ahead to 'manual installation' if you want to install from git.
Download and launch the installer.
Download the DMG and launch the installer.
For the latest stable release:
npm install -g cocos2d
For the latest unstable:
npm install -g [email protected]
If you don't have, or don't want to use npm, you can install by downloading the latest Zip.
Then from your terminal run
You don't need to use the installer if you don't want to. You can download the latest ZIP or checkout the latest version from github.
If you checkout from github and don't have Node.js installed, be sure to also get the git submodule which includes precompiled Node.js binaries.
git submodule update --init
On Windows use the 'Create project' shortcut from your start menu to create and select a location for your new project.
On Linux and Mac OS X open your terminal and run:
cocos new ~/my_first_project
This will create a bare-bones project which simply draws the project name in the centre of the screen.
To test that it's working, on Windows double click the 'Serve project' shortcut in your project's folder.
On Linux and Mac OS X from your terminal run:
cd ~/my_first_project cocos server
Now visit http://127.0.0.1:4000 and with a bit of luck you'll have something showing.
The entry point for the code is the file src/main.js where you'll find an
exports.mainfunction which will be called when your application starts.
The HTML for the page sent by the development server is at public/index.html.template and can be customised if you need any special alterations to it.
To compile your project on Windows double click the 'Compile project' shortcut in your project's folder.
To compile on Linux or Mac OS X open your terminal and run:
cd ~/my_first_project cocos make
Everything is designed to work in Firefox 4, Chrome, Safari, Opera and IE9+. If that is not the case then please file a bug report.
If you wish to generate the documentation yourself you need to follow these steps.
Download JsDoc 2.3 (or 2.4) from http://code.google.com/p/jsdoc-toolkit/.
Copy that to /usr/local/jsdoc-toolkit or wherever you like and then run:
The documentation will appear in the 'docs' directory.
© 2010-2011 Ryan Williams [email protected]