MCPcopy
hub / github.com/piqnt/planck.js / toggleHeavy

Function toggleHeavy

example/HeavyOnLightTwo.ts:44–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42let heavy: Body | null = null;
43
44function toggleHeavy() {
45 if (heavy) {
46 world.destroyBody(heavy);
47 heavy = null;
48 } else {
49 heavy = world.createBody({
50 type: "dynamic",
51 position: { x: 0.0, y: 9.0 },
52 });
53 heavy.createFixture({
54 shape: new Circle(5.0),
55 density: 10.0,
56 });
57 }
58}
59
60testbed.keydown = function (code, char) {
61 switch (char) {

Callers 1

HeavyOnLightTwo.tsFile · 0.85

Calls 3

destroyBodyMethod · 0.80
createBodyMethod · 0.80
createFixtureMethod · 0.80

Tested by

no test coverage detected