baardbi
Well-known member
This tutorial will add the ability to double jump in the platform modules (Arcade Platformer, MetroVania and LR Platformer).
1. Add a new User Variable:
jumpCounter
2. In your jump_throughPlat.asm file add this at the top of the file under SwitchBank #$1C :
Towards the bottom of the file below +doJump: add this:
3. In the physics script (doHandlePhysics_PlatformBase.asm) add this below isSolidSoLand:
That's it.
1. Add a new User Variable:
jumpCounter
2. In your jump_throughPlat.asm file add this at the top of the file under SwitchBank #$1C :
;;; Double jump check
LDA jumpCounter
CMP #1
BEQ +doubleJump
JMP +normalJump
+doubleJump:
JMP +doJump
+normalJump:
Towards the bottom of the file below +doJump: add this:
INC jumpCounter
3. In the physics script (doHandlePhysics_PlatformBase.asm) add this below isSolidSoLand:
;;; Only reset jump counter if the player lands (not other objects)
CPX player1_object
BNE +
LDA #0
STA jumpCounter
+
That's it.