I'm trying to make a generator that subtracts 1 coin from Mario every x frames, and kill him when it reaches 0. I've been trying for some time now but can't get it to work.
This is my current code:
I can't seem to find what's wrong. When testing the generator it does nothing. Doesn't subtract coins and doesn't kill Mario.
This is my current code:
Code
LDA 0DBF ;Loads coin counter BNE HasCoins JSL 00F606 ;Kills Mario if he has 0 coins RTL HasCoins: LDA $14 CMP #$FA ;Branches every 250 frames (5sec) BEQ DecreaseCoins RTL DecreaseCoins: DEC 0DBF ;Takes a coin RTL
I can't seem to find what's wrong. When testing the generator it does nothing. Doesn't subtract coins and doesn't kill Mario.
allow shy guy emojis in post footers you cowards!