12 users online: Angelito, anonimzwx,  BeeKaay, Bonobi, brickblock369, HammerBrother, magianegra21, Morph Moth, MrMartley64,  NopeContest, signature_steve, Stivi - Guests: 125 - Bots: 172
Users: 62,817 (2,619 active)
Latest user: Kaputon

Summon Closest Sprite v1.1 by JamesD28

File Name: Summon Closest Sprite v1.1
Submitted: by JamesD28
Authors: JamesD28
Type: Level, Game Mode
Includes GFX: No
Includes Hijack: No
Featured: No
Description: 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.

Please give credit if used.
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 "featues" 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.
Moderated with:
Lunar Magic 3.11
UberASMTool 1.4
SA-1 Pack 1.32 (also tested without)
Snes9x 1.60

Most of this code seems to work as intended, but there's a notable flaw with springs. By timing it a certain way (ask for a video if you want one), if you bounce on the spring while trying to summon it to you, a second spring will spawn in its place, duplicating it in the process. From my testing I could only get two springs this way, although it could probably be chained more. This problem also only seemed to occur on the non SA-1 version, which was odd. It may have been how my test level was set up between the two, but regardless sprite duplication is a problem. After that's fixed this should be good for approval.