Hi i won't add to much info in here cause the file is pretty well commented.
Hope you find this useful.
If the attached file is not working you can download it from here
Unlock your full gamedev potential
Upgrade to the Personal Edition of Construct 2, it has way more features and won't holding back from making money and using your full creativity like the free edition does. It's a one off payment and all Construct 2 editor updates are free for life!
Plus, it's got a lot of additional features that will help you save time and make more impressive games!