Bucket Mouse
Active member
I'm trying to make a platform tile in the Arcade Platformer module that will hurt you under certain conditions, but if other conditions are met you can stand on it.
This is the Solid Tile script:
It stands to reason that if I dupe this script at the beginning of playerHurt_ArcadePlatformerBase and add the conditions, it should be solid under those conditions. Like this:
But instead, the player falls through the tile. I don't understand why!
The weird thing is that you fall through the tile, but you can't move horizontally while you're in there, as if it remembers "oh yeah, the tile is solid." But you can still jump out.
But that['s not as weird as this: I replaced the tile with a second Solid Tile and got the same result.No alterations -- just a second Solid Tile using the same script.
Why can't I use the Solid Tile script for two different scripts? I asked on the Discord and was told the Solid title isn't actually programmed in the tile code itself -- it's in doHandleTileCollisions_ArcadePlatformBase.asm. So I found the part that was looking for tile #1, and altered it so it would look for tile #2 as well:
It doesn't work. In fact, the tile no longer hurts you in either state. I don't get it! Does anyone know what to do?
This is the Solid Tile script:
Code:
LDA ObjectUpdateByte
ORA #%00000001
STA ObjectUpdateByte ;; makes solid
RTS
It stands to reason that if I dupe this script at the beginning of playerHurt_ArcadePlatformerBase and add the conditions, it should be solid under those conditions. Like this:
Code:
LDA flagUp
CMP #$01
BNE flagIsNotUp
LDA ObjectUpdateByte
ORA #%00000001
STA ObjectUpdateByte ;; makes solid
RTS
flagIsNotUp:
But instead, the player falls through the tile. I don't understand why!
The weird thing is that you fall through the tile, but you can't move horizontally while you're in there, as if it remembers "oh yeah, the tile is solid." But you can still jump out.
But that['s not as weird as this: I replaced the tile with a second Solid Tile and got the same result.No alterations -- just a second Solid Tile using the same script.
Why can't I use the Solid Tile script for two different scripts? I asked on the Discord and was told the Solid title isn't actually programmed in the tile code itself -- it's in doHandleTileCollisions_ArcadePlatformBase.asm. So I found the part that was looking for tile #1, and altered it so it would look for tile #2 as well:
Code:
LDA tempA
BEQ +skipThisTile
CMP #$01
BNE +isNotSolid
JMP +isSolid
+isNotSolid
CMP #$02
BNE +isNotSolid
JMP +isSolid
+isNotSolid
+skipThisTile
LDA tempB
BNE +dontSkipThisTile
JMP +skipThisTile
+dontSkipThisTile:
CMP #$01
BNE +isNotSolid
JMP +isSolid
+isNotSolid
CMP #$02
BNE +isNotSolid
JMP +isSolid
+isNotSolid
+skipThisTile
LDA tempC
BEQ +skipThisTile
CMP #$01
BNE +isNotSolid
JMP +isSolid
+isNotSolid
CMP #$02
BNE +isNotSolid
JMP +isSolid
+isNotSolid
+skipThisTile
LDA tempD
BEQ +skipThisTile
CMP #$01
BNE +isNotSolid
JMP +isSolid
+isNotSolid
CMP #$02
BNE +isNotSolid
JMP +isSolid
+isNotSolid
+skipThisTile
It doesn't work. In fact, the tile no longer hurts you in either state. I don't get it! Does anyone know what to do?