HTML5 prototype of “Pop the Lock” iOS blockbuster using Phaser

Believe or not, Pop The Lock is a blockbuster. It’s part of a game trend which is gaining a lot of popularity during the last months, where you basically have to solve the same level in the same way more and more times consecutively.

Anyway, the game is fun, like other games in the same genre I have already deconstructed like Perfect Square and Circle Path, so here we go with this first step where we’ll analyze the basic movement of the bar and the random position of the lock.

This is what you will learn to do:

Just cick or tap to make the bar move, then click or tap again to move the bar in the opposite direction, changing lock position. At the moment I do not check for a successful “unlock” as this is meant to be a basic example which will be expanded later.

Here is the source code, commented line by line:

And next time, adding just some more lines, we’ll have the complete game. Meanwhile download the source code.