HTML5 Dungeon Raid tile engine made with Phaser – Part 4

Let’s release a new step of Dungeon Raid engine series, adding a couple of features, let me show you a quick recap:

Step 1: very basic prototype with only the capability of selecting adjacent tiles and backtrack if needed.

Step 2: making selected tiles fall and be replaced by new tiles.

Step 3: the engine works with any number of rows and columns, does not destroy tiles (allowing to save memory) and hides falling tiles with a mask, allowing you to easily build a GUI around the game field.

Now, we are going to add colors to tiles so you can only pick tiles of the same color, and set an option to decide whether to allow diagonal movement or not.

Have a look at the result:

Draw to select circles, you can also backtrack and this time diagonals aren’t allowed.

Have a look at the source code, the capability to move diagonally is set at line 12 while possible tile colors are defined at line 13.

The engine is getting more and more complete as I publish new posts, but you won’t guess what iOS blockbuster I am going to create just changing a few lines. You’ll see it next week, meanwhile download the source code.