Link to code is here:
https://pastebin.com/AaPgCCtL
This a close look at an excellent tutorial Warforge did about a year ago. Some things have changed since then, but the basic concepts he discusses remain relevant. We couldn't find a link to the code he showed, so we recreated it with some slight modifications. This is for educational purposes only.