Depth testing input
Handling input manually like in the previous recipe gives us the opportunity to manage touchable objects at a high level.
Using an array of sprites sorted by Z order we can “swallow the input” so that background sprites aren’t affected.