Language…
18 users online:  AmperSam, asterkafton, Dangil, DanMario24YT,  Donut, dotCoockie, drkrdnk, EvilAdmiralKivi, Fiblizo, Golden Yoshi, Guido_Keller, JezJitzu, LightAligns, mmmdoggy,  patcdr, Scags, timothy726, tOaO - Guests: 264 - Bots: 406
Users: 64,795 (2,377 active)
Latest user: mathew

Impact Block Help

Hello, I am asking a question about this block I'm using. I want to change it so that when Mario does run into it at full speed, it doesn't hurt him. Here is the code:

Code
;Impact block based off smkdan's "speedbreakblock"
;shatters and hurts you when hit at full speed
;act like 130

!BREAKSPEED = $60

JMP Return : JMP MarioAbove : JMP MarioAbove : JMP Return : JMP Return : JMP Return : JMP Return

MarioAbove:
	LDA $7B
	BPL NoUnsign	;negative?
	EOR #$FF	;two's complement
	INC A
NoUnsign:
	CMP #!BREAKSPEED	;test for breakage
	BCC Return		;return if speed not reached

	PHB			;preserve current bank
	LDA #$02		;push 02
	PHA
	PLB			;bank = 02
	LDA #$00		;default shatter
	JSL $028663		;shatter block
	PLB			;restore bank

	LDA #$02		;block to generate
	STA $9C
	JSL $00BEB0		;generate
	JSL $00F5B7

Return:
	RTL


Please help, and move this if it is in the wrong section. Thanks!

- BlackMageMario
Originally posted by BlackMageMario
JSL $00F5B7

Remove this.

Oh, and I'm pretty sure speed $60 is impossible. Try $30 or something.
<blm> zsnes users are the flatearthers of emulation
Originally posted by Alcaro
Originally posted by BlackMageMario
JSL $00F5B7

Remove this.

Oh, and I'm pretty sure speed $60 is impossible. Try $30 or something.


Thanks! Also, speed $60 IS possible.

EDIT: Sorry to bother you guys again, but could you make it so that if two of them are on top of each other, and Big Mario collides with them, that they both break? Thanks!

- BlackMageMario
Can someone please help? This is really important. Thanks.

- BlackMageMario
Originally posted by BlackMageMario
Can someone please help? This is really important. Thanks.

- BlackMageMario

Chances are, you need to use ObjecTool to make a custom object. I believe that is the only way to do it, other than having a sprite, which may not fit your circumstances. A tutorial can be found here.
Originally posted by MSAhm3d59113
Originally posted by BlackMageMario
Can someone please help? This is really important. Thanks.

- BlackMageMario

Chances are, you need to use ObjecTool to make a custom object. I believe that is the only way to do it, other than having a sprite, which may not fit your circumstances. A tutorial can be found here.


But why do I need to do that? Couldn't I add something into the code of the block (see first post, I didn't make it, BTW)? Or am I being really stupid?

- BlackMageMario
well what you need to do is make the block act like 25 and not 130 then add a condition where if mario isn't going the correct speed it acts like tile 130.

Also add in the 3 extra JMPs at the begining to make it work better.
Originally posted by ninja boy
well what you need to do is make the block act like 25 and not 130 then add a condition where if mario isn't going the correct speed it acts like tile 130.

Also add in the 3 extra JMPs at the begining to make it work better.


How would I add a condition? I don't actually know ASM, if you couldn't tell... Thanks for you help already, Ninja Boy.

- BlackMageMario
Pretty much use this block it should work the way you want if you set it to act like tile 25.

Code
db $42

;Impact block based off smkdan's "speedbreakblock"
;shatters and hurts you when hit at full speed
;act like 130

!BREAKSPEED = $60

JMP Return : JMP MarioAbove : JMP MarioAbove : JMP Return : JMP Return : JMP Return : JMP Return
JMP MarioAbove : JMP MarioAbove : JMP MarioAbove

MarioAbove:
	LDA $7B
	BPL NoUnsign	;negative?
	EOR #$FF	;two's complement
	INC A
NoUnsign:
	CMP #!BREAKSPEED	;test for breakage
	BCC Return		;return if speed not reached

	PHB			;preserve current bank
	LDA #$02		;push 02
	PHA
	PLB			;bank = 02
	LDA #$00		;default shatter
	JSL $028663		;shatter block
	PLB			;restore bank

	LDA #$02		;block to generate
	STA $9C
	JSL $00BEB0		;generate
	JSL $00F5B7
	RTL

Return:
	LDY #$01
	LDA #$30
	STA $1693
	RTL

Originally posted by ninja boy
Pretty much use this block it should work the way you want if you set it to act like tile 25.

Code
db $42

;Impact block based off smkdan's "speedbreakblock"
;shatters and hurts you when hit at full speed
;act like 130

!BREAKSPEED = $60

JMP Return : JMP MarioAbove : JMP MarioAbove : JMP Return : JMP Return : JMP Return : JMP Return
JMP MarioAbove : JMP MarioAbove : JMP MarioAbove

MarioAbove:
	LDA $7B
	BPL NoUnsign	;negative?
	EOR #$FF	;two's complement
	INC A
NoUnsign:
	CMP #!BREAKSPEED	;test for breakage
	BCC Return		;return if speed not reached

	PHB			;preserve current bank
	LDA #$02		;push 02
	PHA
	PLB			;bank = 02
	LDA #$00		;default shatter
	JSL $028663		;shatter block
	PLB			;restore bank

	LDA #$02		;block to generate
	STA $9C
	JSL $00BEB0		;generate
	JSL $00F5B7
	RTL

Return:
	LDY #$01
	LDA #$30
	STA $1693
	RTL



It sorta works. You see, when Big Mario hits the blocks, only the bottom one is destroyed. It seems that this block was only designed with Small Mario in mind. It only really works with Big Mario when he jumps into the top block.

Is there anyway to change this? Thanks for all the help so far, guys.

- BlackMageMario
when I get home I'll give you the code to the impact block I've made myself as I can get it to break the way you want but that'll be in a couple hours.
I'm STILL having trouble with this! Can anyone help pretty please?

- BlackMageMario
Hey sorry my internet has been out for a bit anyways here is the block I use and I can smash right through them if I set the block to act like 130.

Code
db $42

JMP End : JMP End : JMP Mario : JMP End : JMP End : JMP End : 

JMP End
JMP End : JMP Mario : JMP Mario

!Breakspeed = $29

Mario:
	LDA $7B
	BPL rightspeed
	EOR #$FF
	INC
	rightspeed:
	CMP #!Breakspeed
	BCC notmaxspeed
	LDA #$02
	STA $1693
	LDA #$02 ; Replace block with blank tile 
	STA $9C 
	JSL $00BEB0
 	PHB 
	LDA #$02 
	PHA 
	PLB 
	LDA #$00 ;set to 0 for normal explosion, 1 for rainbow 
	JSR $028663 ;breaking effect 
	PLB 
notmaxspeed:
End:
	RTL
Thanks again Ninja, but it still refuses to work. Just a question: Does the speed HAVE to be 29? I want it to be 60.

Thanks again!

- BlackMageMario
I'm fairly certain that 60 is beyond Mario's maximum falling speed, so you using that would explain why the block doesn't work for you.
My YouTube channel
Get the official ASMT resource pack here!

Originally posted by yoshicookiezeus
I'm fairly certain that 60 is beyond Mario's maximum falling speed, so you using that would explain why the block doesn't work for you.


I've given up. The block just refuses to work. Thanks for all you help, I really appreciate it guys, but I can't see the problem. Thanks anyways!

- BlackMageMario