Language…
8 users online: Brian94, Jordan, masl, Pink Gold Peach, Rykon-V73, Shiki_Makiro, synthie_cat, Zavok - Guests: 245 - Bots: 382
Users: 64,795 (2,377 active)
Latest user: mathew

SMB Castle path-choice effect

SPASM Repository → SMB Castle path-choice effect

Submission Details

Name: SMB Castle path-choice effect
Author: BTD6_maker
Added:
Type: Init, Main
Includes Hijack: No
Featured: No
Description: This code allows you to create a level with multiple paths, where the correct path must be chosen to progress, similar to 4-4 and 7-4 from SMB. You can define several rectangles, and then if Yoshi reaches a particular x-position without entering any of these rectangles all horizontal entrances towards right (sprite 0D0) will despawn. For instance, this can be used to despawn an entrance that sends you back to the start, if you have chosen the correct path, thus allowing you to continue.
Tags: sprites
Comments: 9 (jump to comments)
Rating:
0.0 (0 ratings)
No rating
Download 1.74 KiB | 183 downloads

Comments (9)

rivaldorivero Link
Hi, please help someone, insert this code into the game and download the rom.. I have no knowledge of programming. Thank you in advance.
HammerBrother Link
Code
;This has a list of all coordinates of the rectangles where this will trigger.

LEFTEDGE:
dw $00D0,$00D0,$0210,$0210
RIGHTEDGE:
dw $00F0,$00F0,$0230,$0230
TOPEDGE:
dw $0720,$07A0,$0760,$07A0
BOTTOMEDGE:
dw $0760,$07E0,$07A0,$07E0

!length = #$07			;Replace with actual length of tables, in bytes
...
	.YCheck
	INY
	INY
	SEP #$20
	TYA
	CMP !length
	BCS .AreaReturn


Uh, you utilize label maths to avoid having the user manually entering the length of tables:
Code
CMP #(RIGHTEDGE-LEFTEDGE)-1

 BTD6_maker Author Link
Thanks for that. When I get the chance I will see if I can make those improvements.
 MarioFanGamer Link
Moderated with:
  • Golden Egg 0.005
  • Asar v1.71
  • BSNES v115
Replaced a single instance of $7F0000 in the code with !flag (apperantelly, you forgot this one).

It works... but it could have been more user friendly. For example, I'd specify each box for the wrong path on a single line. I'd also make use of Asar maths so you don't have to specify the entries. You also could have made it so to disable sprite 147 (horizontal entrance to the left).

I also see ways of improvement. One example I can think of is the constant switching between 16-bit and 8-bit mode. I can understand it if you set the flag that the wrong path has been taken but if you compare it, you can just clear the high byte with AND #$00FF. Another example is that you don't use the SRAM mirrors $6000-$7FFF beyond the use of the sprite table $7360,x.

Nonetheless, it is a way to disable horizontal warps depending on Yoshi / the player's path so accepted.
Batata Douce Link
Originally posted by zacmario
That's awesome.. but what heck is spasm

SNES Professional ASM
parakmahonsmwc Link
This comment was written and published 8 months after this was submitted... sheesh.
zacmario Link
Ohh yeah I forgot. Thanks
 MarioFanGamer Link
levelASM for Yoshi's Island.
zacmario Link
That's awesome.. but what heck is spasm