Banner
Views: 875,001,947
Time:
17 users online: 8Nairb, Aeon, Aja, Amine Retro, anonimzwx, Coockie1173, Daizo Dee Von, EliteBellic, Ersanio, FrozenHydra, Gammed Z, monkey03297, phalanx, qantuum, S.U, Soul Storm, TheBiob - Guests: 57 - Bots: 67 Users: 48,790 (2,459 active)
Latest: xmariedetx
Winter C3 2021 Content Spotlight
Stivi's "Super Mario: Nozom Quest" Demo!
Not logged in.
An ASM question (Need help again)
Forum Index - SMW Hacking - SMW Hacking Help - An ASM question (Need help again)
Pages: « 1 » Link
Okay, so, I made a levelASM code, I tried to create my own double jump, and it works! But I noticed that instead of double jumping, I can jump as many times as I want by pressing the jump button. That's not what I'm trying to do.
So, my question is:
How would I make a code only execute once? Ot at least, make the code execute again until I touch the ground?
LINKS Twitter | YouTube | SoundCloud | Fortaleza Reznor
to hear birds and see none.
Create a flag it can check, that resets when touching the ground

Originally posted by code
!Freeram = $xx

;This part should be there somewhere at the top of your levelasm
LDA $13EF
BEQ asdf ;check if mario is touching ground
STZ !Freeram ;if yes, reset custom counter
asdf: ;otherwise, keep the counter as it is

LDA !Freeram ; check freeram to see if player is allowed to jump
BNE notallowed ; if not, skip the jumping routine
INC !Freeram ;if allowed, increase freeram so player can't jump again
;code for jumping here
notallowed:
Hm, I'll see what I can do with that. If I have a question, I'll edit this post. Thanks!

Edit: Eh, it's still not working, Mario kees jumping the amount of times he wants if I press the jump button (well, the spin jump button actually). It should be double jump, not multiple jump. What's wrong?
LINKS Twitter | YouTube | SoundCloud | Fortaleza Reznor
to hear birds and see none.
Try this code
Code
!FREERAM = $60
!JUMP    = $B0

	LDA $77
	AND #$04
	BNE Reset
	LDA !FREERAM
	BNE +
	LDA $16
	AND #$80
	BEQ +
	LDA #!JUMP
	STA $7D
	INC !FREERAM
+	RTS
Reset:
	STZ !FREERAM
	RTS
I change my layout every 4-5 months
Awesome! It works now! Thanks to both Sind and Ramp202!
LINKS Twitter | YouTube | SoundCloud | Fortaleza Reznor
to hear birds and see none.
Pages: « 1 » Link
Forum Index - SMW Hacking - SMW Hacking Help - An ASM question (Need help again)

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2021 - SMW Central
Legal Information - Privacy Policy - Link To Us


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks