Open marrus-sh opened 8 years ago
This is actually already fixed if everything is lined up PERFECTLY… but take the following case:
⬛ | ||
🐊 | ⬛ |
If 🐊 uses TargetBy(1, -1), 🐊 will not go into the gap, because at each calculation the x and y will be a float (and thus a little above, or a little below). Ideally the code would check to see if such gaps are being passed over, and (if possible) try to fit 🐊 in them instead.
(Note: Ideally this should not necessarily be a simple matter of rounding, so that the same holds true if you have two characters at float positions with a similar gap between them, and a third trying to fit between)
Rounding to the nearest pixel may be an appropriate solution to this problem, as it will ensure that any time a sprite looks like it can fit in a hole, it will.
However ^ will not alone solve the problem if the velocity vector is, say, ⟨1, -2⟩ (not possible right now but this may change in the future)
Nearest-pixel rounding has now been implemented, at least
This should be possible, smdh!