HOME

TheInfoList



OR:

Cocos2d is a free
software framework In computer programming, a software framework is an abstraction in which software, providing generic functionality, can be selectively changed by additional user-written code, thus providing application-specific software. It provides a standard ...
. It can be used to build games, apps and other
cross platform In computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several computing platforms. Some cross-platform software r ...
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 In the physical sciences, a particle (or corpuscule in older texts) is a small localized object which can be described by several physical or chemical properties, such as volume, density, or mass. They vary greatly in size or quantity, fro ...
editing,
font In movable type, metal typesetting, a font is a particular #Characteristics, size, weight and style of a typeface. Each font is a matched set of type, with a piece (a "Sort (typesetting), sort") for each glyph. A typeface consists of a range of ...
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 (warp, ripple, etc.).


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 Box2D is a free open source 2-dimensional physics simulator engine written in C++ by Erin Catto and published under the MIT license. It has been used in '' Crayon Physics Deluxe'', ''Limbo'', ''Rolando'', '' Incredibots'', ''Angry Birds'', '' ...
and
Chipmunk Chipmunks are small, striped rodents of the family Sciuridae. Chipmunks are found in North America, with the exception of the Siberian chipmunk which is found primarily in Asia. Taxonomy and systematics Chipmunks may be classified either as ...
.


Audio

Various versions of Cocos2D have audio libraries that wrap
OpenAL OpenAL (Open Audio Library) is a cross-platform audio application programming interface (API). It is designed for efficient rendering of multichannel three-dimensional positional audio. Its API style and conventions deliberately resemble those ...
or other libraries to provide full audio capabilities. Features are dependent on the implementation of Cocos2D.


Scripting support

Support binding to
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
,
Lua Lua or LUA may refer to: Science and technology * Lua (programming language) * Latvia University of Agriculture * Last universal ancestor, in evolution Ethnicity and language * Lua people, of Laos * Lawa people, of Thailand sometimes referred t ...
, and other engines exist for Cocos2D. For example, Cocos2d JavaScript Binding (JSB) for C/ C++/
Objective-C Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its N ...
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

* SpriteBuilder: Previously known as CocosBuilder, SpriteBuilder is an IDE for Cocos2D-SpriteBuilder apps. SpriteBuilder is free and its development was sponsored by Apportable, who also sponsored the free Cocos2D-SpriteBuilder, Cocos3D, and Chipmunk physics projects. It was available as a free app in the
Mac App Store The App Store (also known as the Mac App Store) is a digital distribution platform for macOS apps, often referred to as Mac apps, created and maintained by Apple Inc. The platform was announced on October 20, 2010, at Apple's "Back to the Mac" ...
. Its latest official version is 1.4. Its latest unofficial version is 1.5 which is compatible with cocos2d-objC 3.4.9. It supports Objective-C. * CocoStudio: a proprietary toolkit based on Cocos2d-x, containing UI Editor, Animation Editor, Scene Editor and Data Editor, together forming a complete system; the former two are tools mainly for artists while the latter are two mainly for designers. This is a proprietary project developed by Chukong Technologies. Its latest version is 3.10 which is compatible with cocos2d-X 3.10. It supports C++. In April 2016 it was deprecated and replaced with Cocos Creator.


Current support

*Cocos Creator, which is a proprietary unified
game development tool A game development tool is a specialized software application that assists or facilitates the making of a video game. Some tasks handled by tools include the conversion of assets (such as 3D models, textures, etc.) into formats required by the g ...
for Cocos2d-X. As of August 2017, it supports JavaScript and
TypeScript TypeScript is a free and open source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript and adds optional static typing to the language. It is designed for the development of large appl ...
only and does not support C++ nor Lua. It was based on the free Fireball-X. A C++ and Lua support for creator is under alpha-stage development since April 2017. *SpriteBuilderX, a free scene editor for Cocos2d-X with C++ support and runs on macOS only. *X-Studio, a proprietary scene editor for Cocos2d-X with Lua support and runs on Windows only. *CCProjectGenerator: a project generator for Cocos2d-ObjC 3.5 that generates Swift or Objective-C projects for Xcode.


Supported platforms and languages


History


Cocos2d (Python)

February 2008, in the town Los Cocos, near
Córdoba, Argentina Córdoba () is a city in central Argentina, in the foothills of the Punilla Valley, Sierras Chicas on the Primero River, Suquía River, about northwest of Buenos Aires. It is the capital of Córdoba Province, Argentina, Córdoba Province a ...
, Ricardo Quesada, a game developer, and Lucio Torre created a 2D game engine for Python with several of their 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 An apple is an edible fruit produced by an apple tree (''Malus domestica''). Apple trees are cultivated worldwide and are the most widely grown species in the genus '' Malus''. The tree originated in Central Asia, where its wild ances ...
App Store An App Store (or app marketplace) is a type of digital distribution platform for computer software called applications, often in a mobile context. Apps provide a specific set of functions which, by definition, do not include the running of the co ...
for the iPhone, Quesada rewrote Cocos2d in
Objective-C Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. Originally developed by Brad Cox and Tom Love in the early 1980s, it was selected by NeXT for its N ...
and in June 2008 released "Cocos2d for iPhone" v0.1, the predecessor of the later Cocos2d family. Cocos2D-ObjC (formerly known as Cocos2D-iPhone and Cocos2D-SpriteBuilder), is maintained by Lars Birkemose. Also, the English designer Michael Heald designed a new logo for Cocos2d (the Cocos2d logo was previously a running coconut).


Cocos2d-x

November 2010, a developer from China named Zhe Wang branched Cocos2d-x based on Cocos2d. Cocos2d-x is also a free engine under
MIT License The MIT License is a permissive free software license originating at the Massachusetts Institute of Technology (MIT) in the late 1980s. As a permissive license, it puts only very limited restriction on reuse and has, therefore, high license co ...
, 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 In computing, WYSIWYG ( ), an acronym for What You See Is What You Get, is a system in which editing software allows content to be edited in a form that resembles its appearance when printed or displayed as a finished product, such as a printed d ...
editor for Cocos2d-x and Cocos2D-html5, and a free Cocos3d-x
fork In cutlery or kitchenware, a fork (from la, furca ' pitchfork') is a utensil, now usually made of metal, whose long handle terminates in a head that branches into several narrow and often slightly curved tines with which one can spear foods ...
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: * ShinyCocos, in
Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum (aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapp ...
* Cocos2d-Android, in
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
for Android * Cocos2d-windows, in C++ for
Windows XP Windows XP is a major release of Microsoft's Windows NT operating system. It was release to manufacturing, released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct upgrade to its predecessors, Wind ...
and
Windows 7 Windows 7 is a major release of the Windows NT operating system developed by Microsoft. It was released to manufacturing on July 22, 2009, and became generally available on October 22, 2009. It is the successor to Windows Vista, released nearl ...
* CocosNet, in C# based on Mono * Cocos2d-javascript, in
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
for web browsers * Cocos2d-XNA was born in cocos2d-x community for supporting
Windows Phone 7 Windows Phone 7 is the first release of the Windows Phone mobile client operating system, released worldwide on October 21, 2010, and in the United States on November 8, 2010. It runs on the Windows CE 6.0 kernel. It received multiple large upda ...
, 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.


Games developed with cocos2d

*''
FarmVille ''FarmVille'' is a series of agriculture-simulation social network game developed and published by Zynga in 2009. It is similar to '' Happy Farm'' and ''Farm Town''. Its gameplay involves various aspects of farmland management, such as plowing ...
'' *'' Plague Inc.'' *'' Geometry Dash'' (cocos2d-x) *''
Miitomo ''Miitomo'' (ミートモ in Japanese) is a discontinued freemium social networking mobile app developed by Nintendo for iOS and Android devices. The app, Nintendo's first, allowed users to converse with friends by answering various questions ...
'' (cocos2d-x) *''
Badland Badlands are a type of dry terrain where softer sedimentary rocks and clay-rich soils have been extensively eroded."Badlands" in '' Chambers's Encyclopædia''. London: George Newnes, 1961, Vol. 2, p. 47. They are characterized by steep slopes, ...
'' (cocos2d-iphone) *'' Shadow Fight 2'' (cocos2d-x) *'' Cookie Run: OvenBreak''


See also

*
Starling Framework Starling is an open source game framework used to create 2D games that run both on mobile and desktop platforms. It recreates the traditional Flash display list architecture on top of accelerated graphics hardware. Several commercial games have ...
*
FlatBuffers FlatBuffers is a free software library implementing a serialization format similar to Protocol Buffers, Thrift, Apache Avro, SBE, and Cap'n Proto, primarily written by Wouter van Oortmerssen and open-sourced by Google. It supports “zero-copy ...


References


Further reading

*


External links

* {{Video game engines C Sharp libraries Free computer libraries Free game engines Free software programmed in Objective-C Free software programmed in Python Python (programming language)-scriptable game engines Software using the MIT license Software using the BSD license Video game development software