louisstow/Crafty — Issue #147: Collision Events get implicitly cancelled
Author: robkuz
Created: 2011-11-26 13:20:07+00:00
State: open

When a collision event is created and one of the listeners to that event
reverts the condition that lead to that collision event in the first place
the event gets silently cancelled out for all following listeners (callbacks).

This leads to the effect that one has to take care in which order listeners
to onHit are added and what those listeners do. At the end it makes for
very brittle code.

please see the fiddle over here http://jsfiddle.net/robertj/przxN/7/

Only if the order of the two onHit callbacks is reversed the debug message
is ever printed.