Jump to content

Cocos2d

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Bmearns (talk | contribs) at 12:08, 26 March 2014 (→‎Sprites and scenes: fixed incorrect order of link and text.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

cocos2d
Initial releaseFebruary 29, 2008 (2008-02-29)
Stable release
0.6.0[1] / March 24, 2014; 10 years ago (2014-03-24)
Repository
Written inPython
PlatformCross-platform
LicenseMIT License
Websitecocos2d.org

Cocos2d is an open source framework. It can be used to build games, apps and other graphic interface interactive apps on cross platforms. Cocos2d contains many branches, the famous ones are Cocos2d-iPhone, Cocos2d-x, Cocos2d-html5 and Cocos2d-XNA. There’re some independent editors in cocos2d community, such as SpriteSheet Editors, Particle Editors, Font Editors and Tilemap Editors, also some world editors like CocosBuilder and CocosStudio.

cocos2d for iPhone
Initial releaseJune 25, 2008 (2008-06-25)
Stable release
2.0.0[2] / July 8, 2012; 12 years ago (2012-07-08)
Repository
Written inObjective-C
PlatformCross-platform
LicenseMIT License
Websitecocos2d-iphone.org
cocos2d-X
Initial releaseNovember 29, 2010 (2010-11-29)
Stable release
cocos2d-2.2.2[3] / January 7, 2014; 10 years ago (2014-01-07)
Repository
Written inC++
PlatformCross-platform
LicenseMIT License
Websitecocos2d-x.org

Sprites and scenes

All versions of Cocos2D work basic primitive of sprites. A sprite can be thought of 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.

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 (warp, ripple, etc.).

GUI

Cocos2D provides primitives to representing common GUI elements in your game scene. 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 (JSB) 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.

Editors Support

  • CocoStudio: a toolkit based on Cocos2d-x, containing UI Editor, Animation Editor, Scene Editor and Data Editor, togethering forming a complete system; the former two are tools mainly for arts while the latter two mainly for designers. This is an close source project developed by Chukong Technologies.
  • CocosBuilder: a free tool under MIT license built for Cocos2d's Javascript bindings, meaning that your code, animations, and interfaces will run unmodified on iPhone, Android and HTML5; readers available for Cocos2d-iPhone and Cocos2d-x for C++ users; it is no longer being maintained and version 2.1 is the latest stable and recommended version to download.
  • SpriteBuilder: SpriteBuilder is the next generation of CocosBuilder where the CocosBuilder project left off. It features everything found in CocosBuilder but expands support for Android, physics, and Cocos2D v3. SpriteBuilder is open source and its development is sponsored by Apportable who also sponsor the open source Cocos2D-iPhone, Cocos3D, and Chipmunk physics projects.

Supported Platforms and Languages

Branch Target Platform API Language
Cocos2d-x iOS, Android, Windows 8, Windows Phone 8, Windows, Linux, Mac OS X C++, Lua, Javascript
Cocos2d-iPhone iOS, Mac OS X, Android Objective-C
Cocos2d-html5 HTML5-ready browsers Javascript
Cocos2d-xna Windows Phone 7&8, Windows 7&8, XBox360 C#

History and Branches

Feb. 2008, in a town called “Los Cocos” near Córdoba in Argentina, Ricardo Quesada, a game developer, created a 2D game engine 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”.

Shortly after, AppStore was officially founded and Apple released related SDK, a big number of developers were attracted and various apps and games got on iOS platform. In this year, Ricardo rewrote Cocos2d in Objective-C and released “Cocos2d for iPhone” v0.1, and that’s the predecessor of the later Cocos2d family.

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

  • ShinyCocos, in Ruby
  • Cocos2d-Android, in Java for Android only
  • Cocos2d-windows, in C++ for Windows XP/7 only
  • CocosNet, in C# base on Mono
  • Cocos2d-javascript, in Javascript for browsers

Also, the well-known designer from England Michael Heald designed a new logo for Cocos2d as shown (before it was a running coconut).

At the same time, Cocos2d developers accomplished the earliest peripheral tools - Zwoptex and Particle Designer. The latter allows developers to get the effect that used to cost them two hours within 15 minutes.

Nov. 2010, a developer from China named Zhe Wang branched Cocos2d-x based on Cocos2d. Cocos2d-x is too an open source engine under MIT License, and it allows for compiling and running on multiple platform with one code base.

In 2013, since Android’s raising, Ricardo Quesada left cocos2d-iPhone and joined in cocos2d-x team. In 2014, there are 5 cocos2d branches being actively maintained.

Cocos family members

  • Cocos2d-x & Cocos2d-html5 is maintained and sponsored by developers at Chukong Technologies Inc. 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.
  • Cocos2d-iPhone is actively maintained by the open-source community. It supports Android by compiling the Objective-C code to run natively on Android using either Apportable and Stella. Lars Birkemose is leading Cocos2d-iPhone project and is sponsored by Apportable who also provides commercial support for Cocos2D-iPhone. CocosBuilder was branched and relaunched as SpriteBuilder in late 2013 by Apportable.
  • Cocos2d-html5 is also maintained by cocos2d-x team.
  • Cocos2d-XNA was born in cocos2d-x community for supporting Window Phone 7, but now it’s branched to an independent project using C# and mono to run on multiple platforms. Jacob Anderson at Totally Evil Entertainment is leading this branch.
  • Cocos3d works as an extension on cocos2d-iPhone, written in Objective-C. Bill Hollings at Brenwill Workshop Ltd is leading this branch.

References

  1. ^ "cocos2d CHANGELOG".
  2. ^ "cocos2d for iPhone CHANGELOG".
  3. ^ "History versions of Cocos2d-x".

External links

Template:IPhone video game engines Template:Open source video games