It's hard to find tutorials when you're trying to create something innovative. I've posted the link to the source file in the comments, if you don't mind digging around the messy code.
My suggestion is to get familiar with the tools (game engine or framework of your choice), and then there will be solutions for any mechanics you want to make.