Language…
12 users online:  AmperSam, CroNo, DanMario24YT, EvilAdmiralKivi, fsvgm777, Guido_Keller, JezJitzu, Sweetdude, timothy726, tOaO, Tomi P, Zavok - Guests: 261 - Bots: 320
Users: 64,795 (2,377 active)
Latest user: mathew

Making a boss..?

I'm wanting to make a Rip Van Fish boss that gets killed with throw blocks after 3 hits, is 32x32 and chases the player non-stop (unless hurt). I have the disassembly of the Rip Van Fish to do this (going to work off of it as a base).

I have a few questions (obviously):

1) How would I make the sprite 32x32? I can't find the graphics routine in it anywhere.
2) How would I make it take 3 hits with throw blocks to kill? Could I just mash code from a Big Boo Boss disassembly in?

Thanks.
Originally posted by MercuryPenny
1) How would I make the sprite 32x32? I can't find the graphics routine in it anywhere.

im guessing it jumps to the standard sprite gfx routine, in which case you can't make it 32x32 unless you code your own gfx routine for it

Originally posted by MercuryPenny
2) How would I make it take 3 hits with throw blocks to kill? Could I just mash code from a Big Boo Boss disassembly in?

worth a shot (usually works). if it doesnt work, then it shouldnt be hard to code. basically just -check for contact with throw block -decrease hit counter if so -destroy throw block
To get things started, you'll want one variable containing the boss' HP (usually this would be $1528,x) and one variable that indicates the boss is hurt/stunned (hint: $1540,x is decrements itself and is perfect for this). You'll want to store the boss' maximum HP to the Hp counter in the INIT routine to set things up.

For the movement, you can just copy-paste the code from Rip Van Fish. Before that, though, you'll want to put LDA !StunTimer : BNE NoMovement, where !StunTimer is whatever address you use to track how long the boss should be stunned after getting hit, and NoMovement is a label after the movement routine.

To make it 32x32, just add Xdisp to your graphics loop. It's four 16x16 tiles, so set up your tables like this:

Code

Tilemap:	db !Tile1,!Tile2
		db !Tile3,!Tile4

Xdisp:		db $00,$10
		db $00,$10

Ydisp:		db $00,$00
		db $10,$10



Then start off your graphics loop by setting some address (the X register is probably better) to 3. At the end of the graphics loop (before the JSL!) put INY#4 : DEX : BPL .Loop. .Loop is obviously the label you loop to. Note that you need the sprite index back in X before the JSL (I think, not sure).

Oh, yeah, the hitbox detection! There are routines for that in SMW, actually. They're located at $03B6F9, $03B6E5, and $03B72B. What you do is this:

Code

CHECK_CONTACT:

		JSL $03B6F9		; Get sprite A clipping
		PHX
		LDX #$0B		; Start at highest sprite index
.Loop		LDA $14C8,x
		BEQ .Next
		JSL $03B6E5		; Get sprite B clipping
		JSL $03B72B		; Check for contact
.Next	DEX
		BPL .Loop
		PLX
		RTS

.Contact:	!MoreCode
		BRA .Next




Instead of !MoreCode you put check if the sprite is a thrown object (probably means $14C8,x = $0A). If it is, decrement the boss' HP and store some value to the stun timer (to stun it, duh).
I think that's all. Hopefully it's helpful.

allow shy guy emojis in post footers you cowards!
Originally posted by Von Fahrenheit
[...] and one variable that indicates the boss is hurt/stunned (hint: $1540,x is decrements itself and is perfect for this).

How would I make it only be stunned for, say, 3 seconds (or 180 frames)? The description of it in the RAM map says it's used by Goombas and Mechakoopas for when to "get up" which is somewhere along the lines of 20 seconds.

Originally posted by Von Fahrenheit
graphics stuff

Interesting. Let's see if I actually understand all this enough to make it actually not crash horribly.

Thanks for helping so much thus far, by the way.
Originally posted by MercuryPenny
Originally posted by Von Fahrenheit
[...] and one variable that indicates the boss is hurt/stunned (hint: $1540,x is decrements itself and is perfect for this).

How would I make it only be stunned for, say, 3 seconds (or 180 frames)? The description of it in the RAM map says it's used by Goombas and Mechakoopas for when to "get up" which is somewhere along the lines of 20 seconds.


The Goomba is actually only stunned for a little more than 6 seconds. It writes 0xFF (255) to the timer, which equates to 6,25 seconds. That is also the maximum amount. To stun your sprite for any number of seconds, write the amount of seconds times 60 to the timer. To stun it for 3 seconds, just do:

Code

	LDA #180			; I would actually advise against using hex here
	STA $1540,x



Note that you can't write values larger than 255 (FF), since the timer is only 8 bits large.

allow shy guy emojis in post footers you cowards!