Take a look at
https://vimeo.com/417381980, showing the game Paratrooper. The canon fires missiles into the top left corner. Helicopters coming from the right that fly into the firing line correctly fire a precollision event. Helicopters from the left do not; they don't emit a precollision event. My only two theories are that, either, 1) if the box isn't fully in the screen, no collision events can occur yet, or 2) the missile that hits the helicopter needs to have been added to the scene *after* the helicopter was added to the scene.
But both of these theories sound absurd.
Do you have an intuition what might be going on? Both actors use colliding type Passive.
Relevant code below. Note that no 'precollision' logs appear on the console for helicopters coming from the left. (And, yes, it's the exact same code that makes helicopters appear either from the left or right; they only differ in the initial position,velocity, and sprite.)
this.on('precollision', (ev) => {
console.log('precollision');
if (ev.other instanceof Missile) {
this._explode();
}
});
Thanks.