Game loop partially defined. To be completed