implementation of basic game loop. Exit condition, and arrows controls