After trying to code the game using Phaser, I decided to rewrite the entire code so it behaves just like (or as near as) what I've done on Phaser.