Building the 2048 game for iOS

We launched the 2048 Game on iOS in April 2014. We started developing the iOS version of the game (based on the initial web based version from Gabriel Cirullli) after the game was already well pass its peak.

Why we did it?

There were enough clones already, right? Why did we build another one? Well, we had this cool idea of placing two players against each other (as in the Letterpress Game) on the same board, playing in turns, competing to merge as many tiles as possible. The rules were simple, two players share the same board and get points only for the tiles that they merge. In every turn, in addition to scoring more points, the player had to think about how to stop the other one from scoring in his next turn. We enjoyed this format so much that we used to play this on the traditional web version by manually noting scores and taking turns.

The first version

With the ultimate goal of building the multiplayer community of players competing against each other, we started working on the first version. We wanted to keep it simple, but we wanted to keep it native, not some webview based clone that just bluntly opens the website in the browser. It was the first game that we were going to develop, so we had no idea where to start. The board was just tiles, so we used the UICollectionView to put tiles in, added some game logic and it was done. Not yet!

The default animations in the UICollectionView assumed that all the items came from just one group which means that moving an item out of a row meant that all other items in next rows change their positions. We had to use fake cells to perform the animations between items and completely disable the default UICollectionView animations. Not too small, but nothing copmlicated either. Take a look.

We even added a simple tilt control by using CoreMotion that allows you to move tiles by tilting the phone. Check out the deviceMotionDidUpdate: method to see the details.

The launch

We launched the first version without the multiplayer option to the AppStore in hopes of getting enough users for the app so that when the multiplayer version comes out, we would have a community of players already there to try out the game and players don’t have to wait a lot to find another player to play with. Was this move successful? Sort of. We got close to two thousand players in a few weeks. I know that this wasn’t great, but it wasn’t too bad either considering there were already tons of clones doing the same thing already.

More details about the multiplayer version here.

Published 10 Sep 2014

I build mobile and web applications. Full Stack, Rails, React, Typescript, Kotlin, Swift
Pulkit Goyal on Twitter