Press "space" to see the hitbox. Move with arrow keys. How this wall collision works is very easy! When the character (hitbox) touches any wall, it undoes the movement! Pretty simple, right? Click the "see inside" button to see how does it work better! Also it shows how the hitbox can appear by just clicking the spacebar!
Credits to the Scratch Team for the wizard-frog and background, @NComendant for the idea and to me for the level design.