Jumping is broken, :(

Post Reply
User avatar
Croque_Monsieur
Posts: 23
Joined: Mon Aug 05, 2019 8:26 pm
Location: Mexico

Jumping is broken, :(

Post by Croque_Monsieur » Tue Aug 13, 2019 6:52 pm

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

; 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: Select all

;; 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.


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.
User avatar
Dirk
Posts: 386
Joined: Fri Mar 09, 2018 5:30 am

Re: Jumping is broken, :(

Post by Dirk » Tue Aug 13, 2019 7:16 pm

Could you post a screenshot of how you have set your input scripts in the input editor?
-----
Disclaimer: English is not my first language, so mistakes are bound to happen.
User avatar
Croque_Monsieur
Posts: 23
Joined: Mon Aug 05, 2019 8:26 pm
Location: Mexico

Re: Jumping is broken, :(

Post by Croque_Monsieur » Tue Aug 13, 2019 7:33 pm

User avatar
Mugi
Posts: 771
Joined: Thu Dec 27, 2018 8:30 pm

Re: Jumping is broken, :(

Post by Mugi » Tue Aug 13, 2019 7:58 pm

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
"what are you up to?" "Oh, not much... just... Parallaxing"
- Raftronaut
User avatar
Croque_Monsieur
Posts: 23
Joined: Mon Aug 05, 2019 8:26 pm
Location: Mexico

Re: Jumping is broken, :(

Post by Croque_Monsieur » Tue Aug 13, 2019 9:12 pm

Yep, the emulator was all messed up. Thanks Mugi!
User avatar
dale_coop
Posts: 4463
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Jumping is broken, :(

Post by dale_coop » Tue Aug 13, 2019 10:11 pm

Mesen loves the turbo function...
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
Post Reply