generic 2D java game approach