This is an easy min/max system for bouncing pmpd masses in a maze / expandable.
https://patchstorage.com/pmpd-micro-platformer-pd-vanilla-pmpd-gem/
this new one has much smaller boxes https://patchstorage.com/pmpd-drawing-ball-game-pd-vanilla-gem-pmpd/