Language…
12 users online: ASSATAKKU,  Donut, DPBOX, Golden Yoshi, masl, Rauf, Shomi, signature_steve, Sweetdude, timothy726, tOaO, zAce08xZ - Guests: 233 - Bots: 311
Users: 64,795 (2,377 active)
Latest user: mathew

[Solved] Wrong sound effect playing?

I do not have custom music stuff inserted in there yet.

For some reason, when i kick a shell into this block, that acts like tile 25, it makes this vine pop out SFX instead of the spring SFX. If the shell happens to hit the block a second time, it does play the correct sound effect. Why?

Video

Code
print "Lauches the sprite that touches it to the left, because i can."

db $42

JMP No : JMP No : JMP No
JMP Yes : JMP Yes
JMP No : JMP No
JMP No : JMP No : JMP No

Yes:
	LDA $14D4,x				; \ 
	XBA					; |
	LDA $D8,x				; |
	REP #$20				; |
	CLC					; | Change the sprite's y position by -2.
	ADC #$FFFE				; |
	SEP #$20				; |
	STA $D8,x				; |
	XBA					; |
	STA $14D4,x				; /
	LDA #$EE				; \ Set the sprite's y Speed to #$F8.
	STA $AA,x				; /
	LDA #$81				; \ Set the sprite's x Speed to #$81.
	STA $B6,x				; /
	LDA #$08				; \ Play the "springboard" sound effect.
	STA $1DFC				; /
	
	LDA $14E0,x		; sprite X position high byte
	STA $9B			; block X position high byte
	LDA $E4,x		; sprite X position low byte
	AND #$F0		; directly on a tile
	STA $9A			; block X position low byte
	LDA $14D4,x		; sprite Y position high byte
	STA $99			; block Y position high byte
	LDA $D8,x		; sprite Y position low byte
	AND #$F0		; directly on a tile
	CLC					; | 
	ADC #$10				; |
	STA $98			; block Y position low byte


	LDA #$02		; tile to generate = blank tile
	STA $9C		;

	JSL $00BEB0	; generate a tile
	
No:
RTL


EDIT: I just remembered, i already posted that code, about a different problem. huh.
It might be caused by the fact that $00BEB0 changes Y and therefore screws with the acts like setting. Try preserving Y and see if it fixes your issue.
I didn't realize that tile 125 was the ? block with the key until i read that. It's been fixed, thanks!

But why is it screwing up with the Acts like settings? Whats more confusing is why didn't it spawn a brown block or bounce block with a sprite?
Originally posted by Lucky Bacon
But why is it screwing up with the Acts like settings?


Because during block code Y always holds the highbyte of the acts like setting so changing it when the block returns means that it changes the highbyte of the acts like setting.

As for why the block isn't spawning it could be due to the fact that you call the "generate tile" routine before the code of tile 125 runs.