Demo code for http://journal.stuffwithstuff.com/2014/07/15/a-turn-based-game-loop/