This code allows Mario to summon the closest carryable sprite, horizontally, into his hands. The closest sprite will be put into his hands instantly as long as he isn't already holding something, and it will also detect kicked sprites. Could be useful for puzzle levels, or Kaizo levels involving summoning sprites in a tight order to perform specific tricks.
Summon is performed by holding X or Y (by default), then tapping L or R.
Usage note: If using in your hack, it may be wise to let the player know that it only measures horizontal distance, not vertical.
Update v1.1: Bug fixes, and made some of jankier "features" of the code into optional defines. Also made a few small optimizations, moved the SFX/Bank to defines, and allowed the user to customize the hold input.
v1.2: Fixed a bug where springboards could be "revived" and summoned in dead/despawned states.