Banner
Views: 944,811,202
Time:
12 users online: Aja, Daffster, Heraga,  Lazy, LouisDoucet, Luaxon,  MarioFanGamer, mateochips, MysteryWood, Natsuz2, OEO6, OnlySpaghettiCode - Guests: 65 - Bots: 58 Users: 52,531 (2,023 active)
Latest: BlinkmanX
Tip: Ask the author for permission before extracting any resources, such as graphics, music, or ASM from a hack or other non-public source (such as SPC files).
Not logged in.
How do you delay an event? Custom block.
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - How do you delay an event? Custom block.
Pages: « 1 » Link
I am trying to make a block that after Mario touches it, will turn into the next Map16 block after a set amount of time.

My block is working correctly, I just do not know how to go about adding a delay timer.

Could someone please help with this?

Code
!Sound = $0B		
!SoundPort = $1DF9

db $42
JMP Main : JMP Main : JMP Main : JMP Return : JMP Return : JMP Return : JMP Return
JMP Return : JMP Return : JMP Return

Main:
	
	LDA #!Sound
	STA !SoundPort
	
	REP #$10
	LDX $03
	INX
	%change_map16()
	SEP #$10
	
Return:	
	RTL
Originally posted by Flat5Games
I am trying to make a block that after Mario touches it, will turn into the next Map16 block after a set amount of time.

My block is working correctly, I just do not know how to go about adding a delay.


You are thinking about blocks the wrong way.

First things first, blocks won't run their code without any sort of contact triggering their code. So they cannot for sure honour the delay even if code it in.

What the original game does about that is that they spawn a special type of sprite called bounce block sprite, which removes the block completely, spawning a solid invisible one.
Then they play an animation and then they do something (like spawn a sprite or give you coins), then they turn the block back to something when the animation ends, like a used block, or maybe they go back to their original form.

Issue is, the vanilla ones are severely limited on what you can do with them, so you would likely need a custom bounce block sprite. There's a patch for that made by GHB and MFG. There are examples too on how to make a new bounce block sprite and how to effectively use them around the site.

--------------------
Your layout has been removed.
Pages: « 1 » Link
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - How do you delay an event? Custom block.

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