Friday, October 25, 2013

How to create a match 3 Android Game like Candy Crush Saga?

As mentioned before, the Candy Crush Saga, with the basic concept of the Match 3 game, stands out to be an extraordinarily successful game.

Then, instinctively, you will ask yourselves, "Can I become similarly successful if i make another Match 3 game?" And the most importantly, what is the basic algorithm behind the Match 3 game that powers the Candy Crush Saga? By understanding and constructing those skeletons, you may design your own attractive graphics, sound effects, and animations to package your game.

To your delight, for the next couple of blog posts, the contents will touch about the algorithm of the Match 3 game. Curiosity makes me learn to create this kind of game as well :) . After some research from the search engines, I came out with my own solution (ok, + reference) which I wish you can find it useful for your basic understanding.

No fuzzy codes. It is mainly about the algorithm, with intuitive picture description and lines of pseudo-code.

To summarize, I break down the Match 3 Game algorithm into several parts:


a) Match 3 Game algorithm Part 1 - Game elements terminology and analogy

- A quick understanding of how I define the game elements. It will help a lot before you read the others.

b) Match 3 Game algorithm Part 2 - How to detect if there is a match?

- Basically it is the core part of the game. No third-party framework or library. Everything is from scratch.

c) Match 3 Game algorithm Part 3 - How to determine whether there is no more match?

- An important checking to see whether the game can proceed or not.

d) Match 3 Game algorithm Part 4 - How to enable the user interaction?

- There are a number of approaches. Here I simply use the index difference, with an exception handling.

e) Match 3 Game algorithm Part 5 - Miscellaneous (Special Combinations)

- Include some interesting parts which make the game more impressive and fun.

f) Match 3 Game algorithm Part 6 - A real Android Match 3 Game demo

- The whole tutorial is not convincing without a real game demo. However, the graphics are not emphasized. Yay! It is now in the Google Play Store - Match 3 Pop Saga

Kindly drop a feedback if you find any typo.

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete