Banner
Views: 793,788,686
Time:
8 users online: 7 up, Alucard648, Cheolpeoduck,  KevinM, MiracleWater, PaperLuigi128, SquidMan_Raps, Yoshi Master - Guests: 14 - Bots: 193 Users: 41,429 (1,483 active)
Latest: ncf1975
Tip: If you give the player a cape, be sure they can't cheat and fly over the level with it!Not logged in.
A sprite spawner?
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - A sprite spawner?
Pages: « 1 »
Hello. I'm really new to ASM and barely know how to do anything with sprites. Could someone explain to me how I could make flashing throw blocks and Koopas without shells spawn at a certain location? Thanks in advance.


The basic code to spawn a sprite is this:
Code
	JSL $02A9DE
	BMI EndSpawn
	TYX
	LDA #!SpriteState
	STA $14C8,x
	LDA #!SpriteNumber
	STA $9E,x

	LDA #!XLo
	STA $E4,x
	LDA #!XHi
	STA $14E0,x
	LDA #!YLo
	STA $D8,x
	LDA #!YHi
	STA $14D4,x
	JSL $07F7D2
EndSpawn:
	RTS


Replace the SpriteNumber define with the sprite you want to spawn, and SpriteState with the state you want it to be in (01 for most sprites, 09 with sprite 4-7 for shells and with sprite 53 for throwblocks). Then set the position in place of the XLo/XHi and YLo/YHi values, or you can set it to be equal to an address as well.

You can stick this in LevelASM; you don't have to use a sprite. If you still want to, though, then to spawn it at the sprite's position you'd use this varient instead.

Also, for spawning a throwblock, if you want it to still disappear after a certain amount of time, add this between the last JSL and the EndSpawn label:
Code
	LDA #$FF
	STA $1540,x

(or you can change the #$FF to however many frames you want it to last)

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Thank you so much! This helped a lot.
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - A sprite spawner?

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

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


Total queries: 7

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • SMBX Community
  • ROMhacking.net
  • MFGG