Jumping is broken, :(

Croque_Monsieur

New member
I've seen posts about people fixing the jumping script and I tried those to no success. I also followed the tutorials on YouTube verbatim and nothing...
Here's the script for jumping I got:
Code:
; a jumps
 
   LDX player1_object
   ;;; let's check for if we are standing on a jumpthrough platform,
   ;;; for which "down and jump" will jump downwards through
   ;;; comment this out if you do not want that functionality
    LDA screenFlags
    AND #%00100000 ;; does it use gravity?
    BEQ dontJump
    
   LDA Object_physics_byte,x
   AND #%00001000
   BEQ notStandingOnJumpThroughPlatform
   LDA gamepad
   AND #%00100000
   BEQ notStandingOnJumpThroughPlatform
   LDA Object_y_hi,x
   CLC
   ADC #$09
   STA Object_y_hi,x
   JMP dontJump
notStandingOnJumpThroughPlatform:
   
   LDA Object_physics_byte,x
   AND #%00000001
   BNE canJump
   LDA Object_physics_byte,x
   AND #%00000100
   BEQ dontJump
    
canJump:
    ;;; TURN OFF "STANDING ON JUMPTHROUGH PLATFORM" if it is on
    LDA Object_physics_byte,x
    AND #%11110111
    STA Object_physics_byte,x
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    LDA #$00
    SEC
    SBC #JUMP_SPEED_LO
    STA Object_v_speed_lo,x
    LDA #$00
    SEC
    SBC #JUMP_SPEED_HI
    STA Object_v_speed_hi,x
    GetCurrentActionType player1_object
    CMP #$03 ;; attack
    BEQ +
    ChangeObjectState #$02, #$04
   +
    PlaySound #SND_JUMP
dontJump:
    RTS

And here's the one I have for var_jump:
Code:
;; variable jumping.
    
    LDX player1_object
    LDA screenFlags
    AND #%00100000 ;; does it use gravity?
    BEQ skipVarJump
    LDA Object_v_speed_lo,x
    CLC
    ADC #$00
    LDA Object_v_speed_hi,x
    ADC #$00
    BPL skipVarJump
    LDA Object_v_speed_hi,x
    CMP #$01
    BCC skipVarJump
    LDA #$00
    SEC 
    SBC #$01
    STA Object_v_speed_hi,x
skipVarJump:
    RTS
Here's a little demo of said broken ineffective jumping, reminds me of the NES version of Terminator, lol.
https://imgur.com/fBu8OFh

For the control scheme I imported what I found within the tutorial assets folder to ensure I was not messing up myself. Also, completely unrelated maybe, but this is the help forum... Anybody here knows how to make combined inputs? Like, say I want to press up + b to perform an attack and stuff like that.
 

Dirk

Member
Could you post a screenshot of how you have set your input scripts in the input editor?
 

Mugi

Member
to me it looks like your emulator is using the turbo button (it keeps repeatedly pressing and releasing the jump button)
using the var jump makes releasing the jump button drop you down so this happens.

please double check your button configs
 
Top Bottom