Simple jump + directionnal pad

Subotai

Active member
Hi,

I'm doing a scrolling platformer..a Castlevania style. I'm using the a_simple_jump.asm in modulescripts\Simpleplatformer
I've set "A" button to jump.

Working : Jump by holding a direction, jump in that direction too.

Problem : If I click only on "A", it doesn't jump at all.

Here's the original 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



Thanks for your help !
 

dale_coop

Moderator
Staff member
Are you sure you correctly assign your script to your buttons in the Input Editor?
Maybe you assign it on "Press" Left + A ?

You're the first person I heard having this issue.
 

dale_coop

Moderator
Staff member
You should remove the ladder script. It’s nlt a input script, it’s a tile script.
All the ladder tiles used this script. It’s automatic when you will be on a ladder tile and press up, you will go up.
No need to assign this script here (and it might cause issues, here).
Try again your jumps, after removing it.
 

dale_coop

Moderator
Staff member
Weird, I have no idea what’s going on...
If your’re ok, could you send me your NESMaker folder zipped, I could check and tell you what is the cause of the problem with your project and give you a fix?
 

dale_coop

Moderator
Staff member
Check your Player's action step, and unset the "ignore gravity". This flag stops objects from moving vertically... (and horizontally too, originally, but I fixed that in my projectiles tutorial)

2019-01-22-08-01-52-NES-MAKER-4-1-4-Version-0x158-Kings-Curse-MST.png
 
Top Bottom