Holding B to Run

n8bit

Member
As the title suggests, I am trying to figure out how to increase the player speed while holding the B button like in the Mario series.

Has anyone implemented this?
 

dale_coop

Moderator
Staff member
If you want to implement it as it was in NESMaker 4.0.X ...

Edit the script assgined to the "Physics" element in your "Project Settings > Script Settings", around line 50 (more precisely, just before the line ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"), add this block of code:

Code:
;;;;;;;;; CHECK FOR SPRINT ;;;;;;;;;;;;;;;
	CPX player1_object
	BNE dontCheckForSprint
	LDA gamepad
	AND #%00000010	;; is "B" pressed?
	BEQ dontCheckForSprint
	;;; should sprint
	LDA temp3
	CLC
	ADC #$01		;; value of the boost for the sprint
	STA temp3
dontCheckForSprint:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 

Dirk

Member
Thank you Dale! I wonder why the old script/functionality got removed in the first place. Running is so fundamental in every jump'n'run so I don't really get it.
 

dale_coop

Moderator
Staff member
Maybe Joe thought this would be better in a separate input script (to assign in the Input Edit)... and forgot to add it?
 

BradiusMaximus

New member
Is the answer to this post still the same in 4.5? I’m looking in project settings > script settings - I see a script titled “doHandlePhysics_PlatformBase.asm”

Is this the script to edit?
 

CluckFox

Active member
The Simple Platformer tutorials implement running in the same way, by checking the gamepad in the physics script. That would indeed be in doHandlePhysics_PlatformBase.asm for that style of game.
 

kevintron

Active member
I'm running the maze mod in 4.5.9. Im tried to implement this as talked about above and could not get it to to work. I also tried create a new input script with this and was also unsuccessful. Is this not compatible with that module or am I going about thins wrong?
 

TolerantX

Active member
I'm running the maze mod in 4.5.9. Im tried to implement this as talked about above and could not get it to to work. I also tried create a new input script with this and was also unsuccessful. Is this not compatible with that module or am I going about thins wrong?
Quick reply: yeah I think they are referring to the platformer modules. Maze uses an entirely different physics.
 
Top Bottom