Name: | Level constrain |
Author: | HammerBrother |
Added: | |
Version History: | View |
Tool: | Asar |
Requires Free Space: | Yes |
Bug Fix: | No |
Featured: | No |
Description: | Unlike screen constrain, this patch constrains the player and sprite's interaction with blocks within the level (properly, check out the first gif to see why). |
Tags: | anti-cheat lorom needs remoderation over the level sa-1 under the level |
Comments: | 5 (jump to comments) |
Download
3.78 KiB | 185 downloads
Comments (5)
However, because the patch assumes that horizontal levels always have a bottom border at Y=$01A0, this is not the case if you change the “Horizontal Level Mode” in “Change Properties in Header” to other than the first option saying “Level height=01B tiles, Max H-Screens=20”.
Therefore if the player or sprite is below Y=$0190 (2D Y-positions values increases as they descend), the player/sprite will only interact with blocks at Y=$01A0, causing the bottom of the newly expanded area useless. Currently, I'm trying to find a RAM value that is based on the level dimension setting.
This is what needs to be changed:
..HorizontalLvl REP #$20 LDA #$0190 CMP $96 ;\Check if bottom boundary is is above mario BMI ..SetYPosCollisPoint ;/(mario is too far below) ..NormalYPosition LDA $96 ..SetYPosCollisPoint CLC ADC $00E89C,x STA $98
Sprite_HorizLvl_blk_interYPos: ;>$0194D4 LDA #$0000 ;>Top of level CMP $0C ;>Collision point Y position BPL .Exceed ;>If top of level below collision point (collision is above) LDA #$01AF ;>Bottom of level CMP $0C ;>Collision point Y position BMI .Exceed ;>If bottom of level is above collision point (collision is under) SEP #$20 JML $0194DD ;>Continue on with code .Exceed STA $0C .Align16x16 SEP #$20 AND #$F0 ;\So it doesn't glitch out with blocks ($0194C5) STA $00 ;/that need 16x16 alignment JML $0194DD ;>Continue on with code
Good job.