Basic Java 2D game loop and render functionality