Cocos2D is undoubtedly the library (or framework) par excellence of game development for mobile platforms. It is open source, free and is the basis on which Apple based to create its own version called Sprite Kit. Now Cocos2D has just made available to everyone a preview of its latest 3.0 version, which allows you to play with it and see all the possibilities: fully integrated with Xcode, development in Objective-C and future support for compiling for Android. Discover what this version offers and what it will bring in the future.
Cocos2D is one of the most widely used video game development solutions. Not only for iPhone, but for cross-platform development (the same development running on Android and iOS, for example). OS X, Linux, Windows, Windows Phone, Firefox OS or even browsers with HTML5 Canvas support are supported.
It is based on the OpenGL standard and what it does is create a simple and intuitive way to program a two-dimensional environment within a 3D fixed camera environment . Well known games, like the award winning Badland, are developed with this library.
Cocos2D, as an open source project, has undergone several changes and is now mainly divided into two major projects: Cocos2D-X based on C++ code and which allows the creation of games on almost all platforms with a single development and this Cocos2D for iPhone that we are dealing with today, which is based entirely on Objective-C code (the one used natively for programming in Apple) and which works from the Xcode program. There are other versions, but these are the most important.
The good news is that after months of development and changes in their responsible (in addition to the appearance of the Apple solution, Sprite Kit whose base is this library), has just seen the light the first previous version in its version 3.0 . A version that allows developers or wannabes to play around with the new possibilities it offers.
The most important change in this new version is the support of ARC or Automatic Reference Counting . When we create an object for an iOS or OS X program (an image, a variable, an array… whatever) what we do is reserve memory for it and save it.
Until some time ago, with the model called MRC or Manual Reference Counting once that object had been used we had to “free” it or delete it from memory, leaving that space free for other possible uses. If this wasn’t done correctly, it would generate leaks or memory leaks that could ruin the performance and memory usage of your application, even causing it to hang up.
What ARC does is create, analyze and automatically generate the memory releases of everything we declare when the compiler detects that it’s no longer useful , saving us a lot of development time and the tedious work of having to clean up after ourselves. Until now, Cocos2D did not support this form of programming and we had to “patch” our game so that the libraries worked manually, although our code did so automatically.
Current and Future Functions
Descarga de Cocos2D v3 Preview
Usa tu cuenta de Facebook para dejar tu opinión.
The functions that Cocos2D 3.0 incorporates or will incorporate, and that will make the day-to-day work much easier are
- Developed in compliance with semantic versioning, which will make future updates require no adaptations or changes in our code to make them work.
- Code cleaning, better defined names and elimination of obsolete or unused classes. All private parts are no longer shown to be more comfortable in terms of what we can use.
- Improvements in pulse detection, making each node able to detect its own touches or multiple touches
- Physics integrated with sprites and nodes, using Objective-C (until now physics had to be programmed in C or C++).
- Integration with UIKit, being able to integrate any element of this as buttons, lists, fields, scrollers … only with a simple instruction and being able to control their properties as an object of Cocos2D.
- Improved multi-resolution support, so we can develop once and it fits any tablet or smartphone.
- Better support of truetype fonts with integration of shadows or enhancement.
- Official support for cross-development through Apportable, compiling the games directly for Android without touching a single line of code Note that although this feature may require a paid license from the SDK that allows conversion to Android 2.2 or higher, which is commercial and not open source, the conversion of Cocos2D 3.0 will be free.
In addition to this, the development team is working on a series of tools that will make creation even easier, such as the tool SpriteBuilder that will allow the resources of a project to be managed centrally, to graphically construct the scenes or levels , to test and define animations or particle systems and much more.
As you can see, the future is promising and right now we can install and test a preview of it with all its possibilities and start to see how it works. Maybe in a short time we can see your new game made in Cocos2D 3.0 in our applications section of the week.