writing own 2d engine Phy2d