Code
JMP MarioBelow : JMP MarioAbove : JMP MarioSide : JMP SpriteV : JMP SpriteH : JMP MarioCape : JMP MarioFireBall
MarioBelow:
MarioAbove:
MarioSide:
;Be like 130 until mario has 50 coins then let him pass
LDX #$29 ; save correct sound effect for later
LDA $0660
CMP #$01 ; if $0660 = 1.., block = passable with SFX
BEQ Correct
CMP #$02 ; if $0660 = 2.., block = passable with no SFX
BEQ MarioFireBall
LDA $0DBF
CMP #$32 ; if coins aren't 50
BCC Wrong ; jump to Wrong
SEC
SBC #$32 ; subtract 50
STA $0DBF
LDA #$01
STA $0660 ; set flag to indicate that the block is passable
BRA Correct
Wrong:
LDA #$30
LDY #$01 ; cement
STA $1693
LDX #$2A ; wrong sfx
STX $1DFC
RTL
Correct:
STX $1DFC ; store correct sound effect which was preserved earlier
LDA #$02 ; set flag to 02 to indicate it's been passed already
STA $0660
SpriteV:
SpriteH:
MarioCape:
MarioFireBall:
RTL
Und das ist mein geänderter code
Code
JMP MarioBelow : JMP MarioAbove : JMP MarioSide : JMP SpriteV : JMP SpriteH : JMP MarioCape : JMP MarioFireBall
MarioBelow:
MarioAbove:
MarioSide:
;Be like 130 until mario has 8 coins then let him pass
LDX #$29 ; save correct sound effect for later
LDA $0660
CMP #$01 ; if $0660 = 1.., block = passable with SFX
BEQ Correct
CMP #$02 ; if $0660 = 2.., block = passable with no SFX
BEQ MarioFireBall
LDA $0DBF
CMP #$32 ; if coins aren't 8
BCC Wrong ; jump to Wrong
SEC
SBC #$32 ; subtract 8
STA $0DBF
LDA #$01
STA $0660 ; set flag to indicate that the block is passable
BRA Correct
Wrong:
LDA #$30
LDY #$01 ; cement
STA $1693
LDX #$2A ; wrong sfx
STX $1DFC
RTL
Correct:
STX $1DFC ; store correct sound effect which was preserved earlier
LDA #$02 ; set flag to 02 to indicate it's been passed already
STA $0660
SpriteV:
SpriteH:
MarioCape:
MarioFireBall:
RTL
jetzt versteh ich aber nciht , warum beide blöcke noch 50 münzen fordern
#