Craigery
Active member
I am trying to make a door where when you enter it moves you to another door on the same screen, kind of like like Bugs Bunny Crazy Castle. So I have codes for 2 tiles, one that makes the player move up and one that makes the player down. Independently they both work as expected. However, when I have both as tiles one overrides the other I think due to STA Object_y_hi,y and STA yHold_hi. I am not sure how to make another Object_y_hi2 and yHold_hi2 or something like that. Am I misunderstanding this? Point me in the right direction please.
This code teleports the player up
and
This code teleports the player down
This code teleports the player up
Code:
CPX player1_object ;;Loads Player
BEQ startStairsUp ;;if Branch is Equal to the player? then go to startStairsUp:
JMP endStairsUp ;;if not then end script
startStairsUp:
LDA tileY
ADC #$D1
STA Object_y_hi,y
STA yHold_hi
ChangeActionStep #$00, #$01 ;; Change to action step 01
endStairsUp:
and
This code teleports the player down
Code:
CPX player1_object ;;Loads Player
BEQ startStairsUp ;;if Branch is Equal to the player? then go to startStairsUp:
JMP endStairsDown ;;if not then end script
startStairsDown:
LDA tileY
ADC #$2F
STA Object_y_hi,y
STA yHold_hi
ChangeActionStep #$00, #$01 ;; Change to action step 01
endStairsDown: