Unfortunately SMBX doesn't keep track of what switch is pressed. It just switches all the blocks from on/off or /off/on each time you press it. But you can make lunadll detect when you press altjump, and you can tell it to swap all blocks in the level with another type of block.
Code: Select all
#-1
SetVar,0,0,0,0,1,SJPressed
#0
OnPlayerMem,0xFC,0xFFFF,0,2000,0,0
OnPlayerMem,0xFC,0,0,2001,0,0
#2000
IfVar,0,0,0,2002,1,SJPressed
#2001
SetVar,0,0,0,0,1,SJPressed
#2002
SetVar,0,0,1,0,1,SJPressed
SwapAllBlocks,1,3,0,0,1,0
#END
This code swaps all blocks of blockID 1 (square wood block) to have block ID 3 (wood flat floor block) and vice versa. If you want to use different block types, change the 1 and the 3 next to SwapAllBlocks to the blocks you want.
You will need the latest version of lunadll by the way because block swap is a new command
http://www.gamearchaeology.com/LunaDll.dll