Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
shakiba committed Dec 24, 2024
1 parent a5f13d0 commit 1a1528e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions example/8-Ball.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ class BilliardPhysics {
const pocket = fA.getUserData() === POCKET ? bA : fB.getUserData() === POCKET ? bB : null;

if (ball && pocket) {
// do not change world immediately
this.world.queueUpdate(() => {
this.world.destroyBody(ball);
this.client?.onBallInPocket(ball, pocket);
Expand Down
2 changes: 2 additions & 0 deletions example/Asteroid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,12 +231,14 @@ class AsteroidPhysics {
const asteroid = dataA?.type == "asteroid" ? bodyA : dataB?.type == "asteroid" ? bodyB : null;

if (ship && asteroid) {
// do not change world immediately
this.world.queueUpdate(() => {
this.client?.collideShipAsteroid(ship, asteroid);
});
}

if (bullet && asteroid) {
// do not change world immediately
this.world.queueUpdate(() => {
this.client?.collideBulletAsteroid(bullet, asteroid);
});
Expand Down

0 comments on commit 1a1528e

Please sign in to comment.