Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add convenience methods for determining if collisions started or stop…
…ped. (#529) # Objective It can be tricky to match and handle all of an entity's collision states in a single event loop. I routinely find myself writing code like this: ``` for Collision(contacts)in events.read() { let started = contacts.during_current_frame && !contacts.during_previous_frame; let stopped = !contacts.during_current_frame && contacts.during_previous_frame; if started { } else if stopped { } ``` ## Solution Add `Contacts::collision_started` and `Contacts::collision_stopped` to more conveniently check these conditions. ## Changelog ### Added - Added `Contacts::collision_started` and `Contacts::collision_stopped` for more conveniently checking if a collision just started or stopped.
- Loading branch information