Skip to content

Commit 785f81e

Browse files
committed
Curved flipper
1 parent 13a2877 commit 785f81e

5 files changed

Lines changed: 34 additions & 41 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"planck": "^1.4.3",
2727
"planck-testbed": "^0.0.7",
2828
"polymatic": "^0.0.12",
29-
"svg-play": "^0.1.0",
29+
"svg-play": "^0.1.2",
3030
"xml2js": "^0.6.2"
3131
}
3232
}

src/Physics.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ export class Physics extends Middleware<MainContext> {
225225
const joint = this.world.createJoint(
226226
new RevoluteJoint(
227227
{
228-
lowerAngle: data.isLeft ? 0 : -1,
229-
upperAngle: data.isLeft ? 1 : 0,
228+
lowerAngle: data.isLeft ? 0 : -0.9,
229+
upperAngle: data.isLeft ? 0.9 : 0,
230230
enableLimit: true,
231231
motorSpeed: 0,
232232
maxMotorTorque: FLIPPER_TORQUE,

src/SvgTable.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Ball, Wall, Flipper, Bumper, Plunger, Kicker, Slingshot, TablePart, Dra
1111
import svgRaw from "./svg-table/ghost.svg?raw";
1212
import { UNIT_PER_METER } from "./Config";
1313

14-
const DEBUG = false;
14+
const DEBUG = true;
1515

1616
/**
1717
* Middleware to load SVG file and create table parts.
@@ -94,12 +94,6 @@ export class SvgTable extends Middleware<MainContext> {
9494
} else if (type === "flipper-right") {
9595
this.rightFlipperBody = vertices;
9696
this.createRightFlipper();
97-
} else if (type === "flipper-left") {
98-
this.leftFlipperBody = vertices;
99-
this.createLeftFlipper();
100-
} else if (type === "flipper-right") {
101-
this.rightFlipperBody = vertices;
102-
this.createRightFlipper();
10397
} else if (type === "drain") {
10498
this.createDrain(vertices);
10599
} else if (type === "plunger") {

src/svg-table/ghost.svg

Lines changed: 26 additions & 27 deletions
Loading

0 commit comments

Comments
 (0)