Java generic 2D game library