📅  最后修改于: 2022-03-11 15:03:50.248000             🧑  作者: Mango
Events.on(engine, 'beforeUpdate', function() {
var gravity = engine.world.gravity;
if (noGravity) {
Body.applyForce(body, body.position, {
x: -gravity.x * gravity.scale * body.mass,
y: -gravity.y * gravity.scale * body.mass
});
}
});