HTML5 prototype of iOS “o:anquan” puzzle game powered with Phaser – finished prototype with flood fill implementation

A couple of days ago I published the HTML5 prototype of iOS “o:anquan” puzzle game powered with Phaser and despite being not complete because I did not include flood fill algorithm, the post got an enormous success with almost 6K views only in its first day.

I planned to release the version featuring flood fill next week, but as a blogger I also have to give people what they are asking for, so here is the finished prototype with flood fill implementation to remove tiles after a move.

Let me jump straight to the point and show you the final prototype:

Select a number and drag it around free tiles to decrease it leaving a trail of “ones”, at the end of each mode a flood fill algorithm is applied to each new tile and will remove all matching tiles.

Flood fill is quite easy to add, here you can see a Flash and HTML5 version in action.

It took me less than 30 lines to add the flood fill, and some of them was to do some kind of indexOf method using pointInArray function because indexOf standard javascript method does not work with Phaser Point class.

Now the concept is:

1 – Place three random numbers (explained in the first part)

2 – Make a move (same as above)

3 – Remove matching number using flood fill

4 – Back to point 1

I highlighted the new lines of code, still no comments because I did not have the time, but I am sure you will appreciate it.

Now let’s see if you can create something interesting out of it, download the source code.

  • Maklaud

    Wow, it’s amazing! Very simple, but very attractive game.
    Please tell your secret. How do you always create absolutely new and interesting game ideas?