Managing Collisions Using Operators and Observables

Learn to emit values through the takeWhile operator.

When a shot hits an enemy, we want both the shot and the enemy to disappear. Let’s define a helper function to detect whether two targets have collided or not:

Get hands-on with 1200+ tech skills courses.