rapidgame

A commandline tool for Mac and Windows that prebuilds cocos2d-x libraries for Mac, iOS, Android and Windows for multiple architectures and configurations, virtually eliminating the need to ever rebuild cocos2d-x or its Javascript bindings.

__________              .__    .___________
\______   \____  ______ |__| __| _/  _____/_____    _____   ____
 |       _|__  \ \____ \|  |/ __ /   \  ___\__  \  /     \_/ __ \
 |    |   \/ __ \|  |_> >  / /_/ \    \_\  \/ __ \|  Y Y  \  ___/
 |____|_  (____  /   __/|__\____ |\______  (____  /__|_|  /\___  >
        \/     \/|__|           \/       \/     \/      \/     \/

RapidGame is a commandline tool for Mac and Windows (Linux support is planned) which:

  1. Prebuilds cocos2d-x libraries for Mac, iOS, Android and Windows for multiple architectures and configurations, virtually eliminating the need to ever rebuild cocos2d-x or its Javascript bindings.

  2. A game project templating system for creating cross-platform games for a variety of game engines, including cocos2d-x, Unity, Corona and Appcelerator Titanium. The default game template creates a simple Breakout clone with a menu and game scene.

Prefer somebody explaining and showing it? Check out the overview video.

  • August 17, 2015: Fixes for Visual Studio 2015.
  • August 11, 2015: On Windows, the path to MSBuild.exe, Lib.exe and VCTargetsPath can be set manually in case they cannot be automatically located.
  • August 2, 2015: Upgraded to cocos2d-x 3.7 (cocos2d-js and cocos2d-x have now been merged into just cocos2d-x).
  • June 2, 2015: Can now prebuild Android on Windows thanks to Samuel Ørsnæs.
  • May 4, 2015: Upgraded to cocos2d-x 3.6 / cocos2d-js 3.6.
  • Mar 15, 2015: Fixed another bug related to MSBuild path on Windows (thanks, Adam Yocum). Fixed the cocos2d-x Android template.
  • Feb 24, 2015: Now has separate cocos2d-x and cocos2d-js templates. Fixed a bug on Windows: "Unable to find MSBuild path."
  • Feb 19, 2015: Fixed a bug in Xcode projects (reference to script folder).
  • Feb 7, 2015: Prebuilder updated for cocos2d-js 3.2 final / cocos2d-x 3.3.
  • Dec 28, 2014: Prebuilder updated for cocos2d-js 3.2 rc0 / cocos2d-x 3.3.
  • Aug 14, 2014: Prebuilder updated for cocos2d-js 3.0 rc2 / cocos2d-x 3.2.

You'll first need Node.js and Git.

There's no need to clone this repo, just install RapidGame:

sudo npm install rapidgame -g

Or, on Windows leave off the sudo and ensure that git is a part of your PATH:

npm install rapidgame -g

And, create a cocos2d-x game named "HeckYeah" (run this as administrator on Windows):

rapidgame create cocos2dx "HeckYeah" org.myorg.heckyeah

Or, a Unity game named "ZombieMatrix":

rapidgame create unity "ZombieMatrix" com.mycompany.zombiematrix

For usage instructions:

rapidgame --help

New to the cocos2d family of game engines? In general, cocos2d-x (rapidgame create cocos2dx) is C++ and cocos2d-js (rapidgame create cocos2djs) is Javascript.

Mac OS X: Xcode 5 or newer, Git and Node.js.

Windows: Visual Studio 2012 or newer (get it for free here), Git, and Node.js. Read the Windows Notes for additional notes you should be aware of.

Linux: support is planned.

Android: please read the Android README or watch the video to find out what you will need for Android development.

RapidGame provides:

  1. Tested game project templates for cocos2d-x / cocos2d-js, Unity, Corona and Titanium
  2. A cross-platform game project creator
  3. A library prebuilder for cocos2d-x

The templates have:

  1. Cross-platform project files
  2. Resolution / ratio-independence
  3. Viewport setup
  4. Menu & Game scenes
  5. Sprites
  6. Custom TTF fonts
  7. Sound
  8. Music
  9. Physics
  10. HTTP game servers (HTML5-based platforms)

The project creator makes a copy of one of the templates, does a search and replace on the game title & package name, then installs any required modules. Viola. Your own rapidly-created game ready to go. Here is some example output from running the project creator:

$ rapidgame create Corona "SwordBall" org.myorg.swordball
Rapidly creating a game
Engine: Corona
Template: TwoScene
Copying project files
Setting project name: Sword Ball
Setting package name: org.myorg.swordball
Done

  Congratulations on creating a Corona game!
  Run it by opening the `main.lua` file in the Corona Simulator.
  Ready to code? Start with the `main.lua` file.

The library prebuilder creates static libraries that virtually eliminate build times for the cocos2d-x engine. With hundreds of source files to be compiled, building cocos2d-x for just one platform can take at least five minutes. This can be a real time sink, especially when switching from the simulator to device triggers a rebuild.

The prebuilder automatically downloads cocos2d-x, patches it to ensure that it can be built from the commandline, then prebuilds cocos2d-x for all possible platforms, configurations and architectures. It is then possible to compile and link native cocos2d-x games in seconds. Even better, the project creator will absolutely symlink to the location of the prebuilt libraries so your game projects stay lightweight and can be moved easily. A regular cocos2d-x game project directory can be half a gigabyte or more. A RapidGame project is around two megabytes.