Cocos2d


Cocos2d is an open source software framework. It can be used to build games, apps and other cross platform GUI based interactive programs.
Cocos2d contains many branches with the best known being Cocos2d-objc, Cocos2d-x, Cocos2d-html5 and Cocos2d-XNA. There are some independent editors in the cocos2d community, such as those contributing in the areas of SpriteSheet editing, particle editing, font editing and Tilemap editing as well as world editors including SpriteBuilder and CocoStudio.

Sprites and scenes

All versions of Cocos2d work using the basic primitive known as a sprite. A sprite can be thought of as a simple 2D image, but can also be a container for other sprites. In Cocos2D, sprites are arranged together to form a scene, like a game level or a menu. Sprites can be manipulated in code based on events or actions or as part of animations. The sprites can be moved, rotated, scaled, have their image changed, etc.

Features

Animation

Cocos2D provides basic animation primitives that can work on sprites using a set of actions and timers. They can be chained and composed together to form more complex animations. Most Cocos2D implementations let you manipulate the size, scale, position, and other effects of the sprite. Some versions of Cocos2D let you also animate particle effects, image filtering effects via shaders.

GUI

Cocos2D provides primitives to representing common GUI elements in game scenes. This includes things like text boxes, labels, menus, buttons, and other common elements.

Physics system

Many Cocos2D implementations come with support for common 2D physics engines like Box2D and Chipmunk.

Audio

Various versions of Cocos2D have audio libraries that wrap OpenAL or other libraries to provide full audio capabilities. Features are dependent on the implementation of Cocos2D.

Scripting support

Support binding to JavaScript, Lua, and other engines exist for Cocos2D. For example, Cocos2d JavaScript Binding for C/C++/Objective-C is the wrapper code that sits between native code and JavaScript code using Mozilla's SpiderMonkey. With JSB, you can accelerate your development process by writing your game using easy and flexible JavaScript.

Editor support

End of life support

BranchTarget PlatformAPI Language
Cocos2dWindows, OS X, LinuxPython 2.6, 2.7 or 3.3+, Objective-C
Cocos2d-xiOS, Android, Tizen, Windows, Windows Phone 8, Linux, Mac OS XC++, Lua, JavaScript
Cocos2d-ObjCiOS, Mac OS X, AndroidObjective-C, Swift
Cocos2d-html5HTML5-ready browsersJavaScript
Cocos2d-xnaWindows Phone 7 & 8, Windows 7 & 8, Xbox 360C#

History

Cocos2d (Python)

February 2008, in the town Los Cocos, near Córdoba, Argentina, Ricardo Quesada, a game developer, created a 2D game engine for Python with several of his developer friends. They named it "Los Cocos" after its birthplace. A month later, the group released the version 0.1 and changed its name to "Cocos2d".

Cocos2d-iPhone

Attracted by the potential of the new Apple App Store for the iPhone, Quesada rewrote Cocos2d in Objective-C and in June 2008 released "Cocos2d for iPhone" v0.1, the predecessor of the later Cocos2d family.
Cocos2D-ObjC, is maintained by Lars Birkemose.
Also, the English designer Michael Heald designed a new logo for Cocos2d.

Cocos2d-x

November 2010, a developer from China named Zhe Wang branched Cocos2d-x based on Cocos2d. Cocos2d-x is also an open source engine under MIT License, and it allows for compiling and running on multiple platforms with one code base.
In 2013, Quesada left cocos2d-iPhone and joined in cocos2d-x team. In March 2017, Quesada was laid off from the Chukong company. In 2015, there are 4 cocos2d branches being actively maintained.
Cocos2d-x & Cocos2d-html5 is maintained and sponsored by developers at Chukong Technologies. Chukong is also developing CocoStudio, which is a WYSIWYG editor for Cocos2d-x and Cocos2D-html5, and an open source Cocos3d-x fork of the Cocos3D project.

Other ports, forks, and bindings

Cocos2d has been ported into various programming languages and to all kinds of platforms. Among them there are: