4.5.6 Double Jump Thorugh JumpThroughBlock

mkjake63

Member
I'm having an issue where my character jumps through the jump through block but once it's in it I'm able to jump again. This is an issue with the arcade platformer since I can just avoid the ladders and continuously double jump to the top. I was wonder how I could go about fixing this issue.
 

mouse spirit

Well-known member
Yes i know this situation. I dont know a fix but i may be able to provide vague help. It has to do with a tile.So when player touching tile, check the code there in the jumpthru tile asm.
I havnt looked myself so im not sure how it works and my laptop is undergoing maintenance. Go ahead and post the script if ya want and i will do my best.
Also i may be incorrect and it could be in other scripts, or aleast the mechanics behind it.
 

mkjake63

Member
Here's my OneWay_SolidTile script

Code:
;;solid tile
LDA Object_v_speed_hi,x
BMI +skipMakingSolid
	LDA ObjectUpdateByte
	ORA #%00000001
	STA ObjectUpdateByte ;; makes solid
+skipMakingSolid
rts

And my jump throughplat script

Code:
;;;; 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Only can jump if the place below feet is free.
    SwitchBank #$1C
    LDY Object_type,x
    LDA ObjectBboxTop,y
    CLC
    ADC ObjectHeight,y
    sta temp2
    
    LDA Object_x_hi,x
    CLC
    ADC ObjectBboxLeft,y
    STA temp
    JSR getPointColTable
    
    LDA Object_y_hi,x
    CLC
    ADC #$02
    CLC
    ADC temp2
    STA temp1
    CheckCollisionPoint temp, temp1, #$01, tempA ;; check below feet to see if it is solid.
                                        ;;; if it is (equal), can jump.
                                        ;;; if not, skips jumping.
     BNE +noJumpYet
        JMP +doJump
     +noJumpYet
    
    CheckCollisionPoint temp, temp1, #$07, tempA ;; check below feet to see if it is jumpthrough platform.
                                        ;;; if it is (equal), can jump.
                                        ;;; if not, skips jumping.
    BNE +noJumpYet
        JMP +doJump
     +noJumpYet
    
    CheckCollisionPoint temp, temp1, #$0A, tempA ;; check below feet to see if it is ladder top platform.
                                       ;;; if it is (equal), can jump.
                                        ;;; if not, skips jumping.
    BEQ +doJump   ;; check second point.
        LDY Object_type,x
        LDA ObjectWidth,y
        CLC
        ADC temp
        STA temp
        JSR getPointColTable
        CheckCollisionPoint temp, temp1, #$01, tempA ;; check below feet to see if it is solid.
                                            ;;; if it is (equal), can jump.
                                            ;;; if not, skips jumping.          
        BEQ +doJump
        
        CheckCollisionPoint temp, temp1, #$07, tempA ;; check below feet to see if it is jumpthrough platform.
                                        ;;; if it is (equal), can jump.
                                        ;;; if not, skips jumping.
        BEQ +doJump
         CheckCollisionPoint temp, temp1, #$0A, tempA ;; check below feet to see if it is ladder top platform.
                                      ;;; if it is (equal), can jump.
                                        ;;; if not, skips jumping.
        BEQ +doJump   ;; check second point.
            JMP +skipJumping
+doJump:
    TXA
    STA temp ;; assumes the object we want to move is in x.
        
    LDY Object_type,x
    LDA ObjectJumpSpeedLo,y
    EOR #$FF
    STA Object_v_speed_lo,x
    LDA ObjectJumpSpeedHi,y
    EOR #$FF
    STA Object_v_speed_hi,x
        
    TXA
    STA temp ;; assumes the object we want to move is in x.
 ;  change the object's action so that he is in jump mode.

+skipJumping:
    ReturnBank
    RTS
 

mouse spirit

Well-known member
So i dont know how well you can read code so if you are advanced excuse my simple explanations. When the code says
STA temp......and then
checkcollisionpoint temp,temp1,00,blah

The code is saving something to temp, then using temp and temp1 and stuff to check collisions. So before...

STA temp

It says LDA object hi x. ...that loads the hi of x, an object, probly you . It loads highs lows probly boundary stuff and so this chunk of code looks like the area to edit.

Then on the lines in between, learn about those lines.
ADC and all that stuff.

Maybe just change some numbers after you back it up or whatever. .
 

mkjake63

Member
Oh okay, I'm still learning and it might be a little too advanced for me still but I'll tinker around this weekend. Thanks!
 

mkjake63

Member
Oh okay, I'm still learning and it might be a little too advanced for me still but I'll tinker around this weekend. Thanks!
 
Top Bottom