📜 ⬆️ ⬇️

cocos2d - framework for creating games for the iPhone

Cocos2d is a small opensource framework for creating 2D games. It was originally created for programs written in python for Windows, Linux and Mac platforms, but then versions for the iPhone and even for Android appeared.

We used it to write our game iTreasure ( link in iTunes ) - a remake of "Secrets of the Ocean" and never regretted it.

Why cocos2d


- Rich features.
Everything you need from the engine for a two-dimensional toys in it. Below I will tell you more about the functionality.
')
- Simplicity.
If you have already written something for the iPhone, then using cocos2d will cost you almost nothing.

- Openness.
The engine has a very good license - the GNU Lesser GPL, which allows it to be used freely in commercial products.

- Big community.
Already more than 200 programs of games made using cocos2d. On the Internet you can find a huge amount of information about the intricacies and problems associated with the use of the engine (although in English).

- Many working examples and open source applications.
First, a lot of working examples are included in the distribution kit of the framework. In addition, many people open the source code of their applications (even sold in the appstore), so that others can find in them ready-made solutions and answers to their questions.

A bit about the capabilities of the framework


- Scene management.
The whole game can be divided into scenes. In fact, the scene can be treated as a small subproject. You can switch between scenes using various effects: fade, slide, rotation, etc.

- Sprites and sprite managers.
The framework provides rich sprite management capabilities. Managers of sprites allow you to operate on the atlas of sprites, which allows you to efficiently use memory. In addition, there are classes for working with sprite fonts, the use of which significantly speeds up text rendering.

- Animation (actions).
Animation in cocos2d is done using special classes called Actions. They can be applied to almost any object in the game. The engine has a large set of types of animations and in addition, you can create your own.

- The basic implementation of the menu and buttons.
Buttons are not as advanced as in UIKit, but for creating game menus, they are quite enough. For text in the menu, you can use sprite fonts.

- Particle system.
The engine supports particle systems. You can create various effects, such as rain, snow, fireworks. Particles can vary in size, rotate, gravity can be applied to them, you can adjust their lifetime and so on.

- Built-in physical engines Box2d and Chipmunk .
Honestly, we didn’t use them ourselves, but the demos look impressive. Collisions, friction, solids, resilience, and more.

- Cocos Live - service for online records.
The engine uses the server provided by Google App Engine to store online records and provides an API for working with these records. But instead of Cocos Live, we decided to use the OpenFeint social network, which also allows users to share their records with other players, and besides this provides many other possibilities. If you are interested, I will tell about it in more detail.

Source: https://habr.com/ru/post/75069/


All Articles