Depending on how often you can have a "rigged" bounce, an incremental solution might be possible.
For this example, I'll assume that:
- Collisions with the playing field boundary are always normal (angle in = angle out)
- Collisions with blocks can be 100% rigged whenever needed (angle out = arbitrary)
Then each time you collide with a block, check whether you have an unimpeded path to the target point without touching another block (but collisions with the boundaries are permitted). If such a path exists, bounce that way.
A fast way to check this is to mirror your playing field and look for a straight-line path to any of the target point's reflections:
In the example you've given, there's no such path - even the best option hits the green row.
So, as a fallback, we just aim for a block that gets us a better view and let the simulation proceed. When we hit that block, this code runs again, and hopefully finds a path directly to the target. If not, it gets incrementally closer each time.
This way you don't need to account for the erosion of the playing field in your algorithm, since you're only ever looking one block impact ahead.
There are a lot of metrics you could use to select this fallback target. You could...
- ...use the mirroring trick above to identify all blocks reachable from both the source point and the target point, and pick a block from the intersection of those two sets.
(Guaranteed to reach your target after hitting this block, if the intersection is non-empty)
- ...select the block visible from the current one that is closest to
the target point.
- ...continue bouncing normally (angle in = angle out) waiting for one
that permits a boundary-bounce-only path. (Makes rigged bouncing less
obvious, but not guaranteed to succeed)
- ...always just bounce toward the reflection of the target point that's closest to lying on the normal bounce vector (angle in = angle out), whether it gets you there or not. This applies a mild bias to all block bounces so it's consistent, and should usually prevent the ball from doing something obviously rigged like reversing course. ;)