Hello!
I'm using this custom sprite (
https://www.smwcentral.net/?p=section&a=details&id=22331) which replicates the mario maker bob-ombs.
However I want the explosion to be able to destroy turn blocks (note that the gif on the above link shows the explosion destroying blocks), but I can't figure out how to do that.
I also tried using this ASM (
https://www.smwcentral.net/?p=section&a=details&id=12428), but this only makes the default bob-omb's explosion destroy blocks.
I tried messing around with both codes, but to no avail.
Can someone help me with that?
Thanks a lot!
--- Edit ---
TheBiob helped me out on Discord, fixing the issue.
Apparently that custom sprite handles explosions in a different way.
Then, after some research on the forums, I tweaked it a little more.
The solution is as follows, in case anyone needs it:
overwrite this section:
CodeCheck_Fuse:
;; Branch away if it's not time to explode
lda !163E,x : cmp #$01 : bne .dont_explode
;; SFX, explode status, explode timer, normal sprie status,
lda.b #!ExplosionSFX : sta.w !ExplosionBank|!Base2
lda #$01 : sta !1534,x
lda.b #!ExplosionTimer : sta !1540,x
lda #$08 : sta !sprite_status,x
JSL $01A7DC|!BankB ; check for Mario/sprite contact (carry set = contact)
BCC + ; don't hurt Mario if no contact is made
JSL $00F5B7|!BankB ; hurt Mario
+
;; set to interact with other sprites
lda !sprite_tweaker_1686,x : and #$F7 : sta !sprite_tweaker_1686,x
;; set to default interaction
lda !sprite_tweaker_167a,x : and #$7F : sta !sprite_tweaker_167a,x
rts
with this
CodeCheck_Fuse:
;; Branch away if it's not time to explode
lda !163E,x : cmp #$01 : bne .dont_explode
;; SFX, explode status, explode timer, normal sprie status,
lda.b #!ExplosionSFX : sta.w !ExplosionBank|!Base2
lda #$01 : sta !1534,x
lda.b #!ExplosionTimer : sta !1540,x
lda #$08 : sta !sprite_status,x
LDA #$15
STA $1887 ; shake the ground
LDA #$0D ;/
STA $9E,x ;\ Sprite = Bob-omb.
LDA #$08 ;/
STA $14C8,x ;\ Set status for new sprite.
JSL $07F7D2 ;/ Reset sprite tables (sprite becomes bob-omb)..
LDA #$01 ;\ .. and flag explosion status.
STA $1534,x ;/
LDA #$40 ;\ Time for explosion.
STA $1540,x
LDA #$09 ;\
STA $1DFC ;/ Sound effect.
LDA #$1B
STA $167A,x
RTS
;; set to default interaction
lda !sprite_tweaker_167a,x : and #$7F : sta !sprite_tweaker_167a,x
rts
Follow Us On