destroyBody method

  1. @override
void destroyBody(
  1. int body
)
override

Destroys body and every joint holding it. Only bodies createBody made: a character's body (characterBody) goes with its character.

Implementation

@override
void destroyBody(int body) {
  // A character's body goes with its character.
  if ((bodies[body]?.character ?? 1) != 0) return;
  _destroyBody(body);
}