4.5.6 Help understanding physics conditions for inputs

WillElm

New member
Sorry, I couldn't think of another way to put it. The big script below is the part of the jump script from the platformer module that checks ground collision for jumping. Does anyone who understands this wanna point me in the right direction? In 4.1.5, I would have just used the physics bytes, like so:

Code:
    LDA Object_physics_byte,x
    AND #%00000001 ;; is it on the ground?

but those throw unknown label errors now. Instead, are we checking the collisions directly? To check for this in a different script, would I just copy/paste the whole thing, of course changing the labels and stuff?

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.
    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
            JMP skipJumping
 
I to am wrestling with this same thing, I just want to use it to kick my player out of their looping jump state, and into my idle/walk state but I just cannot get this to work using the methods you describe.

I tried pasting what you linked below earlier and that had no effect for me either.

I am currently trying to check Object_v_speed_lo and Object_v_speed_hi, but I am not quite sure how to accomplish that, everything I have tried so far is amounting to nothing. I just want is on ground lol.
 

mouse spirit

Well-known member
Try something like.....

What about LDA the v speed hi,
But then CMP to v speed hi.
So whenever its the same it will mean you are in the ground or,not moving up and down..
But sadly it may also trigger at the peak of your jump.
So make it check if its solid colliding also.

Try something like that.Or LDA players x position
then CMP it. If BEQ, do on ground stuff.

W
Essentially what i mean is LDA and CMP against a variable that would be changing unless on ground.
 
Top Bottom