Just a code that recreate the effect of tic-tac blocs in SM3DWorld : it sounds like a tempo and switch the ON/OFF so you need to use ON/OFF blocks
Example : https://www.youtube.com/watch?v=c8FyvJC8ZH4&list=PLvacKDH5GG7emdc6M7ZXfCJXACldLfb5Z&index=4&t=0s
The concept for this is good, but its execution could be cleaner.
- For starters, this was confusing me to what it's supposed to do (I have never played SM3DW) until I saw this was supposed to be used with some ON/OFF blocks. Yes, the description said something among those lines, but still there's no excuse to include the blocks (or link them should they exist already).
- I think including an option for this to use its own switch instead of hardcoding it to the ON/OFF status, so if people still want to use the ON/OFF block's normal functions alongside this tic tac block code.
- The main offender is the code, which is really unoptimized and does some things it shouldn't.
1.- Don't do STZ $14. This will mess up the animations. Since it defaults to .25 seconds or 0x1C frames, and then it resets it after reaching this value, any resource that depends on the frame counter having higher values will break.
2.- You should leave your FreeRAM as a define so the user can change it.
3.- This code could be cleanlier:
...what's the point of this? Yes, it should be 00, but there's no reason to clear it out because nothing else even writes to it.
LDX $14 ;
CPX #$1C ;\
BEQ Tempo ;/
Again, to avoid doing STZ $14, just check the frame counter like this: