It was 2013 and I was still working on projects for the iOS platform. Among the frameworks and libraries for the development of games that I experienced could not miss Cocos2D.
I used Cocos2D to create a very small game that follows the “Same Game” mechanism to distribute it through the CodeCanyon channel.
Given the simplicity of the application it is very easy to customize all aspects of the game (graphics, sounds or even modify the mechanisms that regulates it) or re-use it in other programs.
The structure of the application is very simple. It consists of a few sections and was created to work on all iPhone versions from 3GS to 5S, on iPad and iPod Touch.
From the main menu it is possible to start a new game, set the game options and view the list of the best scores obtained.
The options menu allows you to customize some aspects of the game. In fact, in addition to the classic commands to activate/deactivate sound effects and background music, the game offers the possibility of modifying two parameters:
- The amount of different colors that will appear on the game board, chosen in a range from a minimum of 2 to a maximum of 6
- The size of the game board: small (5×5), medium (10×10) and large (20×20)
The leaderboard shows the best five scores obtained by the player. The current version of the game does not provide the assignment of the score to a specific user.
Once the “Start” command has been selected, the player is taken to a second screen, a submenu, in which he can choose between two game modes:
- The classic mode which provides that, in order to win, the player is able to eliminate all the marbles from the playing area.
- The infinite mode that allows you to play precisely indefinitely, as all the marbles that are removed from time to time from the game board are replaced by the same number, in order to fill the latter again.
Once the game mode is chosen, the player is taken to the final screen with the board in the center of the screen, of the size set in the options menu, filled with randomly scattered marbles of various colors.
From this moment, tapping on the ball of a given color, the game will take into consideration all the marbles of the same color that are adjacent to each other vertically or horizontally, starting from this one. The balls involved will be removed from the board and a score is calculated based on their quantity.
This can then be done if you select a ball that has “at least” an adjacent one of the same color, in summary a minimum of two balls can be removed at a time from the board.
The procedure is repeated, depending on the game mode, until all the marbles have been removed from the board or other ones cannot be eliminated.
If the player needs to see the whole chain of balls adjacent to the selected one, he can hold it pressed for a few seconds. The game will highlight the group of marbles and also indicate the score that will be assigned for their elimination.