So I did find this scripts, I'm trying to follow it to see if there is anything I may need to change but I don't quite understand them just yet. Can anyone tell me, if this looks right and how to read these scripts.....
;;; CHECK FOR SOLID TILE, which is tile type 1 in this module.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; In this module, we have
;; 1 = solid
;; 7 = one way platform
;; 9 = prize block, which behaves as a solid
;; 10 (0A) = ladder, whose top behaves like a solid.
;; Here is where we handle the "landing" scenario for all of those possibilities.
GetCollisionPoint temp, temp1, tempA ;; is it a solid?
CMP #$01
BNE +isNotSolid
JMP +isSolid
+isNotSolid
CMP #$07
BNE +isNotOneWaySolid
JMP +isOneWaySolid
+isNotOneWaySolid
CMP #$09
BNE +isNotSolid
JMP +isSolid
+isNotSolid
CMP #$0A
BEQ +isLadderSolid
GetCollisionPoint temp3, temp1, tempA ;; is it a solid?
CMP #$01
BNE +isNotSolid
JMP +isSolid
+isNotSolid
CMP #$07
BNE +isNotSolid
JMP +isOneWaySolid
+isNotSolid
CMP #$09
BNE +isNotSolid
JMP +isSolid
+isNotSolid
CMP #$0A
BEQ +isLadderSolid
JMP +notSolid
+isLadderSolid
LDA Object_v_speed_hi,x
BEQ +checkSolid
BPL +checkSolid
JMP +notSolid
+checkSolid
LDA temp1
SEC
SBC #$02
SEC
SBC Object_v_speed_hi,x
STA tempy
GetCollisionPoint temp, tempy, tempA ;; is it a solid
BEQ +checkForSecondPoint
CMP #$0A
BEQ +notSolid
GetCollisionPoint temp3, tempy, tempA ;; is it a solid?
BEQ +checkForFirstPoint
CMP #$0A
BEQ +notSolid
JMP +isSolid
+checkForSecondPoint
GetCollisionPoint temp3, tempy, tempA ;; is it a solid?
BEQ +isSolid
JMP +notSolid
+checkForFirstPoint
GetCollisionPoint temp, tempy, tempA ;; is it a solid?
BEQ +isSolid
JMP +notSolid
+isOneWaySolid
;; a special kind of solid
LDA Object_v_speed_hi,x
BMI +notSolid ;; a jumpthrough platform is definitely not solid if moving up through it.
;;; however, it is not solid if we haven't cleared it yet.
TYA
AND #%11110000
CLC
ADC Object_v_speed_hi,x
CMP temp1
BEQ +isSolid
BCS +isSolid
JMP +notSolid
+isSolid
JMP isSolidSoLand
+notSolid:
;; is not solid, don't land.
LDA Object_y_lo,x
CLC
ADC Object_v_speed_lo,x
STA yHold_lo
LDA Object_y_hi,x
ADC Object_v_speed_hi,x
STA Object_y_hi,x
STA yHold_hi
CMP #BOUNDS_BOTTOM
BCC +notAtBounds
CPX player1_object
BNE +destroyNonPlayerObject
LDA #$00
STA screenUpdateByte
JSR doHandleBounds
JMP +notAtBounds
+destroyNonPlayerObject
DestroyObject
+notAtBounds
CMP #$02
BCS +notAtBoundsTop
CPX player1_object
BNE +destroyNonPlayerObject
LDA #$02
STA screenUpdateByte
JSR doHandleBounds
JMP +notAtBoundsTop
+destroyNonPlayerObject
DestroyObject
+notAtBoundsTop
LDA Object_v_speed_lo,x
CLC
ADC #GRAVITY_LO
STA Object_v_speed_lo,x
LDA Object_v_speed_hi,x
ADC #GRAVITY_HI
STA Object_v_speed_hi,x
LDA Object_v_speed_hi,x
CMP #MAX_FALL_SPEED
BNE notOverFallSpeed
;; is at least max fall speed.
LDA #$00
STA Object_v_speed_lo,x
notOverFallSpeed:
JMP doneWithGravity
isSolidSoLand:
;; move to position
;;; load the top of the tile that is being run into.
;;check if in a jumping state.
TXA
STA temp
GetActionStep temp
CMP #$02 ;; presums jump is in state 2
BNE +dontChangeToIdle
LDA gamepad
AND #%11110000
BNE +isRunningWhenLanding
;; is idle when landing
LDA #$00
STA temp1
JMP +gotLandingState
+isRunningWhenLanding
LDA #$01
STA temp1
+gotLandingState
ChangeActionStep temp, temp1 ;; changes to either idle or running depending on if a direction key is pressed.
+dontChangeToIdle
;; force y to tile boundary.
; LDA tileY
; AND #%11110000
; SEC
; SBC self_bottom
; SEC
; SBC #$01
; STA Object_y_hi,x
; STA yHold_hi
LDA #$00
STA Object_v_speed_lo,x
STA Object_v_speed_hi,x
doneWithGravity:
skipPhysics: