Game engine for 2D games