Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you may not be able to execute some actions.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
如何给物体加引力呀
你可以试试给被吸引的对象加一个自定义移动能力,然后每帧执行,被牵引的对象的自定义移动能力速度为某个值,移动方向为angle(被牵引对象.x,被牵引对象.y,引力体.x,引力体.y),这样被牵引的对象就会一直往引力体方向移动,就有“物体引力”的效果了,不过这种是点对点的,如果要做一个长矩形的引力,移动方向就需要计算垂直于长矩形的长边的角度了,会麻烦一些