After having a problem with following the exercises. I decided to look at the suggested code in 06-basic-game-end.
Here I found the code uses a third party physics engine (avian2d) which does seem to make the code pore straightforward, but there is no explanation of how the engine is used in the tutorial documentation.