Hello there,
I tried recently to achieve a way of getting an Arcade Physics Body to emit an event without changing Phaser's source code, however, I found myself unable to do so.
I would kindly drop a pull request adding said functionality, however, I would like to ask here first if is there a way already to do it.
Please let me know if really there is no way to do so at the moment, so I can start and draft a pull request for it.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
Hi - Thanks for the offer of a PR. First, could you explain why you'd need an onBounce event when you've already got onCollide? (as a bounce cannot happen without a collision)
Hello @photonstorm , thank you for the quick response.
In my idea, the reason for having a universal event onBounce is that it would work with both World Bounds and other bodies. It would simplify and prevent the need of keeping track of everything that is collidable and not having to add an add.onCollide() to each possible collidable body, plus, listening for the worldbounds event.
In the following example, you can see that the collide event is not emitted when it happens to a world bound:
Hello there,
I tried recently to achieve a way of getting an Arcade Physics Body to emit an event without changing Phaser's source code, however, I found myself unable to do so.
I would kindly drop a pull request adding said functionality, however, I would like to ask here first if is there a way already to do it.
Please let me know if really there is no way to do so at the moment, so I can start and draft a pull request for it.
Thanks in advance.
The text was updated successfully, but these errors were encountered: