Robert Webb How to install Cocos2dJS

From CS1635 Spring 2016
Jump to: navigation, search

Hello fellow classmates. Due to the complications of installing and configuring Cocos 2d JS, I have decided to make a tutorial on how to do so. We will be using the Cocos Code IDE to create a JS game that can compile to APK.

Why using cocos 2d js? Well JS is really easy to use. It's also well documented by this guy who makes videos.Here is how to make a menu. Basically, if you don't like C++ then this is probably the easiest option. Even if you don't know JS, you can very easily learn if you're familiar with java, even though they're very different.

Why a guide? Cocos in general has terrible documentation, and it's actually very hard to find the resources you need to use it. A lot of my links are not direct download links but actually links to people answering questions on how to get a direct download link. Depending on you having OSX or windows, you may need to click a different link.

Generally people in my class spent about 6-8 hours configuring cocos for use before giving up and asking for help. Hopefully this will reduce your time significantly. Cocos has a lot of dependencies and doesn't really tell you what you need.

What you need to download

Cocos Code IDE


Android NDK You want version r9d

Apache Ant

Cocos 2d js

What you need but probably already have

JVM & Python (2.7)

Android SDK

Steps, after you've downloaded everything

1. Follow the instructions to install Cocos 2d here

2. Launch Cocos Code IDE

3. This screen comes up:


4. You want to set it such that the paths are pointing to the correct folders.

5. Then click the frameworks option. An error might pop up, ignore it.

6. This screen comes up or you may need to select frameworks from the preferences menu under cocos. Ignore the quick option - I don't know what it does.


7. Ignore the lua option. It's just there to confuse you.

8. Make it such that it points to your javascript framework.

9. It could work now! Good luck, I hope this shaves 2-3 hours off of your configuration time.