Template for a 2D game in Java