lecture 5 : game loops (and input)