Making shape disappear in a specific area

I am trying to make a shape disappear once it is released in a certain area of the window. I am unsure how I should look at the problem to make it work. I couldn’t find examples that were interactivity based. All the ones I found rely on a timer or millis. Should I use a boolean or another method I haven’t found yet?

Explore the very informative EXAMPLES area on the processing site:

For example, this simple one shows interaction based on mouse position:

While this example isn’t a specific solution to your goal, it should nudge you in the right direction.