Closed Koopa1018 closed 1 year ago
Due to the branch this was based on now having merged with main, could you rebase/merge this branch from main again? Hopefully that resolves some of the merge conflicts.
Small nitpick: For in the future, if you make a branch based of another branch, please make a pull request trying to merge into that original branch. Not into main. That prevents conflicts like these.
I'll review it after you thought this branch up to date with main!
Huh! I've tried PR'ing into branches before and I thought it wasn't possible. Looks like I somehow just didn't get far enough before.
@jaschutte Update has been accomplished.
Looks great!
Description of changes
Modifies terrain system to support background terrain layers.
NOTE: This PR is branched from #181. New changes start on May 30th.
To make background terrain, two features are required: disable-able collision, and changeable Z-order. Collision was dead simple to connect to a checkbox, so the bulk of the changes here went into Z-sorting.
See, the system was designed to render the top border, then bottom, then sides, and use Z-sorting to put them at the right depth relative to each other. The problem was, this meant a terrain object was on no less than three Z-layers (body, sides, top+bottom). If you wanted to put a terrain in the background, it had to move no fewer than 3 steps at a time in order to stay together--which seems both inconvenient and counterintuitive!
With that in mind, I redesigned the system so the draw steps could be reordered in code (surprisingly non-trivial!), then set it up to draw the different borders from back to front--sorting via draw order rather than Z-order. This means entire terrain objects now only take up one Z-layer, which means they can step backwards and forwards easily (and fit between other layers 😉).
Issue(s)
N/A - wanted to get this workable so I know how to make my grass background look its best.