rubixcuber Jan 23rd, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- To do custom hitboxes, check "Don't use default interaction with Mario" in the cfg editor.
- Note that this means the sprite will no longer damage the player on contact or anything like that, so you'll have to manually call the hurt Mario function upon detecting collision.
- Then basically you just call these 3 functions like this
- JSL $03B664 ;get player hitbox
- JSL $03B69F ;get sprite's hitbox
- ;Here you can change the values like $06 and $07 listed below to manipulate the hitbox
- JSL $03B72B ;compare hitboxes
- BCC NoContact
- ;stuff to do when touching here
- $03B664 59 bytes Subroutine (JSL) "Get player clipping" subroutine. Stores the clipping X displacement low byte to $00, the clipping X displacement high byte to $08, the clipping width to $02, the clipping Y displacement low byte to $01, the clipping Y displacement high byte to $09, and the clipping height to $03.
- $03B69F 70 bytes Sprite subroutine (JSL) "Get sprite clipping A" subroutine. Stores the clipping X displacement low byte to $04, the clipping X displacement high byte to $0A, the clipping width to $06, the clipping Y displacement low byte to $05, the clipping Y displacement high byte to $0B, and the clipping height to $07.
- $03B72B 49 bytes Sprite subroutine (JSL) "Check for contact" subroutine. Uses the values in scratch RAM set by $03B69F and either $03B6E5 or $03B664 (or occasionally custom values) to determine whether two sprites, or a sprite and the player, are in contact. If the carry flag is set after calling this, they are in contact.
RAW Paste Data