kaplay
kaplay copied to clipboard
fix: add return if static to physics apply force functions
I noticed by accident that if a static body collides with an area effector, then the velocity of the static body will still be modified and the static body will fly off into the ether. But it's static, it shouldn't move. This fixes that.
kaplay();
add([
pos(10, 10),
rect(100, 100),
color(BLUE),
area(),
areaEffector({ forceAngle: 0, forceMagnitude: 10 }),
]);
// Wheeeeeee!! I am static but still get pushed!
add([
pos(20, 20),
rect(100, 10),
color(RED),
area(),
body({ isStatic: true }),
]);
wait sorry nvm to that i reread what you wrote
This is both versions? We could say it was a bug?