heavily inspired by http://blog.lessmilk.com/how-to-make-flappy-bird-in-html5-1/