Physics engine for 2D space game