+isOneWaySolid ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Added code for dropthrougt oneway tile when down is pressed CPX player1_object BNE +doneDownPress LDA gamepad AND #%00100000 ;; Down GAMEPAD PRESS ;; BNE +doPressDown JMP +doneDownPress ;; Down not PRESSED ;; +doPressDown: ;; Down is PRESSED ;; LDA gamepad AND #%00000010 ;; is the b button pressed? BNE + JMP +doneDownPress + ;;Lets change player to jump ChangeActionStep #$00, #$02 ;arg0 = what object? ;arg1 = what step? ;; JMP +notSolid ;; DONT MAKE SOLID ;; +doneDownPress: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End added code for dropthroug oneway tile ;; a special kind of solid |
LDA gamepad
AND #%00100000
BNE doPressDown
JMP doneDownPress
doPressDown:
ChangeActionStep player1_object, #$02
JMP +notSolid
doneDownPress:
+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 ;;; <<<-----------Was getting out of range when adding the Down thought plat script.
;;BNE +skipThis ;; To enable Jump Down Thought platforms
jmp +notSolid ;;; Remove to enable down though platforms
GetCollisionPoint temp3, tempy, tempB ;; is it a solid?
BEQ +checkForFirstPoint
CMP #$0A
BEQ +notSolid
JMP +isMidTileSolid
+checkForSecondPoint
GetCollisionPoint temp3, tempy, tempB ;; is it a solid?
BEQ +isMidTileSolid
JMP +notSolid
+checkForFirstPoint
GetCollisionPoint temp, tempy, tempA ;; is it a solid?
BEQ +isMidTileSolid
JMP +notSolid
+isMidTileSolid
jmp +isSolidOnSlope
+isOneWaySolid
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Added code for dropthrougt oneway tile when down is pressed
CPX player1_object
BNE +doneDownPress
LDA gamepad
AND #%00100000 ;; Down GAMEPAD PRESS ;;
BNE +doPressDown
JMP +doneDownPress ;; Down not PRESSED ;;
+doPressDown: ;; Down is PRESSED ;;
LDA gamepad
AND #%00000010 ;; is the b button pressed?
BNE +
JMP +doneDownPress
+
;;Lets change player to jump
ChangeActionStep #$00, #$02
;arg0 = what object?
;arg1 = what step?
;;
JMP +notSolid ;; DONT MAKE SOLID ;;
+doneDownPress:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;End added code for dropthroug oneway tile
;; a special kind of solid
LDA gamepad
AND #%00100001 ;; DOWN + A buttons pressed
CMP #%00100001
BNE +doneDownAPressed
LDA Object_y_hi,x
CLC
ADC #$03
STA Object_y_hi,x
JMP +skipJumping
+doneDownAPressed:
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 +checkMore
;; HERE
Thank you! I did this and it does work but it's really tricky to pull off. It works once and awhile if I keep jamming down and a. I have no idea why it works sometimes and not all times. It does work though, just rarely or the button press window of time must be miniscule.For the 4.5.9, I would just modify the jump_throughPlat.asm input script to add a code like this:
Maybe just after the check for the one-way platform tiles:Code:LDA gamepad AND #%00100001 ;; DOWN + A buttons pressed CMP #%00100001 BNE +doneDownAPressed LDA Object_y_hi,x CLC ADC #$03 STA Object_y_hi,x JMP +skipJumping +doneDownAPressed:
Code: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 +checkMore ;; HERE
;; 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.
BNE +noJumpYet ;;; if not, skips jumping.
JMP +doJump ;; check second point.
+noJumpYet
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.
BEQ +doJump ;;; if not, skips jumping.
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 +checkMore
JMP +doJump
+checkMore
;; this checks if down + A is pressed if so fall through the tile ;;
LDA gamepad
AND #%00100001 ;; DOWN + A buttons pressed
CMP #%00100001
BNE +doneDownAPressed
LDA Object_y_hi,x
CLC
ADC #$03
STA Object_y_hi,x
JMP +skipJumping
+doneDownAPressed:
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.
;; EDIT TO ADD ACTION CHANGE IN PLAYER ;;
ChangeActionStep temp, #$02 ;; assumes that "jump" is in action 2
;arg0 = what object?
;arg1 = what behavior?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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
LDA gamepad
AND #%00100001 ;; DOWN + A buttons pressed
CMP #%00100001
BNE +doneDownAPressed
LDA Object_y_hi,x
CLC
ADC #$03
STA Object_y_hi,x
JMP +skipJumping
+doneDownAPressed:
;; 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; this checks if down + A is pressed if so fall through the tile ;;
LDA gamepad
AND #%00100001 ;; DOWN + A buttons pressed
CMP #%00100001
BNE +doneDownAPressed
LDA Object_y_hi,x
CLC
ADC #$03
STA Object_y_hi,x
JMP +skipJumping
+doneDownAPressed:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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.
BNE +noJumpYet ;;; if not, skips jumping.
JMP +doJump ;; check second point.
+noJumpYet
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.
BEQ +doJump ;;; if not, skips jumping.
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 +checkMore
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; this checks if down + A is pressed if so fall through the tile ;;
LDA gamepad
AND #%00100001 ;; DOWN + A buttons pressed
CMP #%00100001
BNE +doneDownAPressed
LDA Object_y_hi,x
CLC
ADC #$03
STA Object_y_hi,x
JMP +skipJumping
+doneDownAPressed:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
JMP +doJump
+checkMore:
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.
;; EDIT TO ADD ACTION CHANGE IN PLAYER ;;
ChangeActionStep temp, #$02 ;; assumes that "jump" is in action 2
;arg0 = what object?
;arg1 = what behavior?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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
thank you I hope you have a great day!The
Code:LDA gamepad AND #%00100001 ;; DOWN + A buttons pressed CMP #%00100001 BNE +doneDownAPressed LDA Object_y_hi,x CLC ADC #$03 STA Object_y_hi,x JMP +skipJumping +doneDownAPressed:
Needs to be placed before the JMP +doJump line of each collision check with a jumpthrough platform.
(means it should be added twice in the script. And not where you placed it)
Like this:
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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; this checks if down + A is pressed if so fall through the tile ;; LDA gamepad AND #%00100001 ;; DOWN + A buttons pressed CMP #%00100001 BNE +doneDownAPressed LDA Object_y_hi,x CLC ADC #$03 STA Object_y_hi,x JMP +skipJumping +doneDownAPressed: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 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. BNE +noJumpYet ;;; if not, skips jumping. JMP +doJump ;; check second point. +noJumpYet 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. BEQ +doJump ;;; if not, skips jumping. 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 +checkMore ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; this checks if down + A is pressed if so fall through the tile ;; LDA gamepad AND #%00100001 ;; DOWN + A buttons pressed CMP #%00100001 BNE +doneDownAPressed LDA Object_y_hi,x CLC ADC #$03 STA Object_y_hi,x JMP +skipJumping +doneDownAPressed: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; JMP +doJump +checkMore: 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. ;; EDIT TO ADD ACTION CHANGE IN PLAYER ;; ChangeActionStep temp, #$02 ;; assumes that "jump" is in action 2 ;arg0 = what object? ;arg1 = what behavior? ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 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