AllDarnDavey
Active member
I've found a bug in 4.1+ with one way platforms, it seems once you drop through a one way platform (actually just stand on one), it never gets reset and you can then drop through any solid block like they were a one way platform (and easily fall through the world). It looks like the fix isn't in the OneWayTile.asm, but actually in a_simple_jump.asm. It looks like the code to"TURN OFF STANDING ON JUMPTHROUGH PLATFORM if it is on" isn't working properly, but seems to work for me if I move it up to immediately turn off the flag after the check to branch if it's off.
Hope this helps others.
Code:
; a jumps
LDX player1_object
;;; let's check for if we are standing on a jumpthrough platform,
;;; for which "down and jump" will jump downwards through
;;; comment this out if you do not want that functionality
LDA screenFlags
AND #%00100000 ;; does it use gravity?
BEQ dontJump
LDA Object_physics_byte,x
AND #%00001000
BEQ notStandingOnJumpThroughPlatform
;;; TURN OFF "STANDING ON JUMPTHROUGH PLATFORM" if it is on
LDA Object_physics_byte,x
AND #%11110111
STA Object_physics_byte,x
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
LDA gamepad
AND #%00100000
BEQ notStandingOnJumpThroughPlatform
LDA Object_y_hi,x
CLC
ADC #$09
STA Object_y_hi,x
JMP dontJump
notStandingOnJumpThroughPlatform:
LDA Object_physics_byte,x
AND #%00000001
BNE canJump
LDA Object_physics_byte,x
AND #%00000100
BEQ dontJump
canJump:
LDA #$00
SEC
SBC #JUMP_SPEED_LO
STA Object_v_speed_lo,x
LDA #$00
SEC
SBC #JUMP_SPEED_HI
STA Object_v_speed_hi,x
GetCurrentActionType player1_object
CMP #$03 ;; attack
BEQ +
ChangeObjectState #$02, #$04
+
PlaySound #SND_JUMP
dontJump:
RTS
Hope this helps others.