
This post will be useful to developers who have just embarked on the rainbow path gamedev. In our recent
post we have already talked about the initial steps of our dream team in the field of igroystroy. As promised, we are working in this direction further and decided to try ourselves in a different genre of games. Next will be briefly covered some moments of creating and publishing the game on two platforms, iOS and android.
Development tools
Cocos2d-x

Previous experience has shown that being sprayed onto two platforms (ios \ android) is quite wasteful, especially with a game project. In this regard, the choice fell on cross-platform. At that time, I had experience with Unity3D and Cocos2d. And since the proposed project was a 2D game, the choice fell on the cross-platform implementation of
Cocos2D-x . Not the last role in the selection was played by the engine's
freebie open source.
')
Cocos2d-x is an open game engine whose source code is distributed under the MIT license. For cross-platform development for iOS, Android, Windows Phone, BlackBerry, Tizen platforms, languages ​​like C ++, Javascript, Lua can be used. Below is a table with platforms, where “o” means that everything works coolly, and “i” means that development is supported, but not recommended.

The platform has a large community that will not leave you in the lurch. Of the famous companies that use this engine, you can mention Zynga, Konami, Glu, Gamevil and KingSoft. Also recently, Microsoft Open Technologies has
contributed to easy porting games to Windows 8 and Windows Phone 8.
JS Development
Our project was developed using javascript. Using Javascript Binding-a argue for faster development than C ++, as well as the ability to run the project in browsers (convenient debugging of the project in the browser console).

Writing a game using javascript is available in all cocos implementations - cocos2d-x, cocos2d-ios and cocos2d-html5. But while cocos2d-html5 runs in a browser, cocos2d-x / ios provide js-binding, which allows a significant increase in performance. In fact, the entire engine code - graphics, rendering, physics, etc. - will be executed natively, and the game logic itself will be executed in javascript. Also, by means of simple manipulations, it is possible to implement the most resource-intensive operations natively.
SpiderMonkey is used as a javascript engine.
The only browser where the game brakes were not observed is Safari (although the recommendations recommend using Chrome). By simple
manipulations, we launched a project on the ZTE Open with Firefox OS on board.
When using js to modify the base code, you must also modify the binding of new methods, although this can be done automatically with the help of the
bindings-generator .
Cocosbuilder
CocosBuilder is an indispensable assistant for us - it is a free tool (released under the MIT license) for the rapid development of games and applications. With it, you can manage scenes, sprites, interface elements, animation of objects, etc. There is a system of particles that can be prepared using the built-in tools or a special tool
Particle Designer . You can also customize frame-by-frame animation, set the sequence of animations, and more.
Currently javascript is supported only in
alpha version 3 . Available for Mac OS only. You can get acquainted with the possibilities
here and
here .
CocoStudio
CocoStudio - appeared not so long ago and was created as an alternative to CocosBuilder. Previously, the interface was only in Chinese, and most recently it was translated into
normal English.
When launched, the program presents a choice of 4 editors:
- UI editor– buttons, lists and the like. So far, 12 interface elements are available, but they promise to add more.
- Animation editor - according to the developers, this editor is similar to Adobe Flash animation. The main focus is on skeletal animation, as well as the usual frame-by-frame animation. There is a texture packer.
- Data editor - allows you to convert data from excel tables into data suitable for processing in cocos2d-x.
- Scene editor - allows you to manipulate all parts of the project, received from the first three editors. That is, you can emulate the game level. It is also possible to use third-party auxiliary tools, such as particle designer.
In general, a quick inspection of the possibilities makes it clear that the product has a bright future. Unfortunately, only the windows version is available, so we have not used this editor in our developments yet.
Tile Map Editor
Tile is an open source project that we used to create levels.

Work with tiles can be described in the following steps:
- First choose the base size of the map, as well as the size of the tile.
- Add to our TileSets atlas with pictures.
- Place the tiles on the map.
- We save the map in a standardized tmx format.
The created maps are saved in the TMX format (Tile Map XML) - they allow to flexibly describe the map with tiles of various sizes, different numbers of layers, objects and their properties. For example, you can set different layers for surface tiles, for decorations. It is also convenient to set the motion paths of objects. Through setting properties to tiles, you can programmatically replace them, for example, with any dynamic objects.
Excellent posts for acquaintance to the level-editor:
time ,
two .
Texture packer
Texture Packer - use to create atlases with textures. You can publish for various platforms, such as Cocos2d, Corona, Sparrow, LibGDX, LimeJS, Ogre, etc. Available for Mac, Win and Linux. This company also provides another excellent product, the
Physic Editor , which we use in the current project.

Build project
Building the project begins with publishing in CocosBuilder, where iOS, android, and html5 settings are separately taken into account.

Further, in the case of iOS, we open the project in Xcode and enjoy launching the game on the simulator or device.
But in the case of android you need to tinker a bit. You need to configure the paths to android NDK, SDK and cocos2d-x, and then upgrade the project using the script build_native.sh. Then you can open the resulting project in Eclipse (or Idea) and work with the manifest and java code. By the way,
ready-made frameworks already exist for payments and some ad networks, but for us it was not difficult to use native code for both platforms.
More information about the settings of publishing can be read
here or
here .
For our game we set a minimum version of ios 5.0. For android, the minimum version is 4.0, although it is possible to make 2.3, but our game is designed for devices with a large screen, and in later versions the probability of crashes is significantly reduced, so for now they have decided to test the performance on newer devices.
Launch and promotion
In total, the game took us about 1.5 months of development. Much of the time was spent on familiarity with the engines and utilities. The project was on the Apple Store on the fifth of November night, and the next morning we started the promotion. Most of the pledged funds for the promotion, we focused on advertising in the Facebook mobile application, setting the targeting only on the USA and on the interests relevant to our game. We also bought a few Shars and likes and retweets, in the hope of a word of mouth effect on Google + / Vk / Facebook social networks.
The rest of the advertising campaign went without money and consisted of sending press releases to editors of Internet publications about iOS / Android with the aim to interest them with our game and the opportunity to get into some kind of weekly digest or even with the possibility of reviewing the game itself.
But, unfortunately, advertising on Facebook did not give those positive results that we managed to achieve with our other game and practically passed without a trace. The advertising budget for the USA is likely to be easily multiplied by 10 compared with Russia (ios).
The highest positions that have been achieved at the moment are only six countries where the game has entered the top 50 in the “Strategy” category and about 30 countries where it ranges between 200 and 300 places in the same category.

Some more or less noticeable results in the general top games or the general top of all applications were not achieved. In the upcoming time, we will make an effort to cross-connect with our existing applications, as well as purchase a couple of reviews at w3bsit3-dns.com, for example (there, by the way, the developer support policy has changed). Let's try targeted Facebook Ads on European countries (most likely Spain, Germany, Italy, have not yet decided). Most of the forces and means throw on the iOS platform, as the exhaust will be much more. In general, this was our first project regarding cross-platform development, with all its pluses and minuses, so to speak, first attempt at writing, and we like what came out of it, let's hope that the upcoming promotion will help to slightly raise and keep the game in the top.
Summing up, I want to note that the current tools make it easy to create games, there would be ideas. We are waiting for your questions on the process of work.