Banner
The Overworld Design Contest ends in
10 DAYS, 11 HOURS, 44 MINUTES AND 45 SECONDS
Views: 904,734,564
Time:
13 users online: BlueToad, ft029, GRIMMKIN, grisu, JonnyManjiro, Klug, margot, Neidave, NewPointless, Nint, OhMuramatsu,  RussianMan, UTF - Guests: 51 - Bots: 80 Users: 50,721 (2,094 active)
Latest: S1eep
Tip: Try playing around with the Horizontal Level Settings in Lunar Magic. You can create some uniquely-designed levels unlike anything seen in the original Super Mario World.
Not logged in.
Spawning a sprite with relative coordinates [SOLVED]
Forum Index - SMW Hacking - SMW Hacking Help - Spawning a sprite with relative coordinates [SOLVED]
Pages: « 1 » Link
Hi. I'm using this code to spawn a throw block:
Code
	JSL $02A9DE
	BMI EndSpawn
	LDA #$09
	STA $3242,y
	LDA #$53
	STA $3200,y
	LDA $322C,x
	STA $322C,y
	LDA $326E,x
	STA $326E,y
	LDA $3216,x
	STA $3216,y
	LDA $3258,x
	STA $3258,y
	PHX
	TYX
	JSL $07F7D2
	PLX


...but every time the code runs it hurts the boss because it takes damage on contact with sprite 53. Could someone tell me how I can spawn it 1 block under the sprite? Thanks.
Just add CLC : ADC #$10 in between the load and the store for whichever of those addresses is the vertical position low byte, move the vertical position high byte lines to directly after the low byte ones, and put an ADC #$00 in between those as well. A higher value means a lower position so adding a value to the new sprite's position makes it spawn lower, and the second addition is to change the high byte as well in case the low byte overflows.

--------------------
My YouTube channel
Get the official ASMT resource pack here!

Thank you! That was extremely helpful.
Pages: « 1 » Link
Forum Index - SMW Hacking - SMW Hacking Help - Spawning a sprite with relative coordinates [SOLVED]

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