A basic 2d game engine in java