HTML5 prototype of iOS game “Perfect Square!” made with Phaser using only tweens in 100 lines of code

Did you play Perfect Square! by Boombit?

Fit the square onto the platform so that it’s aligned perfectly. Touch it to grow and release to let it fall! It may sound simple, but this one touch game will take super precision and timing to master it!

Although it may seem a physics game, I can show you it can be made only with tweens, thanks to Phaser.

Let’s have a look at the prototype I made:

Press and hold to make the square grow, release to drop it. As you can see all the cute animations you can see in original game have been featured.

I am showing you the source code, still uncommented but a step by step explaination will follow later this week

As you can see it’s only made with tweens, there isn’t any physics engine in it.

Download the source code.

  • When I make a square bigger than the top platform it falls to the middle platform what is physically impossible. I think it should stay on the top platform in that case (like on the screenshot 4 of the original game which displays player’s fail on the level 4).

    • Emanuele Feronato

      My fault, you should replace line 96 from

      y: game.height – this.leftSquare.height


      y: destY