The code and its explanation can be found inside the project. Code is free to use. You can use it without tagging me.
I created the game's levels using Tiled. Let me know if I should make a tutorial on how to use it :) There are only 3 levels.