This is just code you can copy for your own games. Of course you can change the kind of game from a clicker to whatever you want.
Griffpatch made the tutorial for the base code, and I tweaked it a little bit to reduce lag.