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:
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:
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