Open TheMaverickProgrammer opened 2 months ago
There's still the topic to discuss: I'm in favor of providing onStart()
with an initial progress value to calculate the starting conditions from since MoveEffect
can be affected by bounds checks.
@spydon
In the case that dProgress becomes negative it is supposed to go backwards. Say that the previous progress is 0.9 and it it supposed to move backwards to 0.8, then dProgress should be -0.1, not 0.1.
Try running only the the MoveToEffect with alternate: true.
Please try running the tiled_example/lib/main.dart
example with from my PR and compare it with the same example in upstream after adding the ViewportAwareBounds
to the camera in the upstream version. From our conversation, this issue seems to be missed and it's crucial to understanding the problem that is being addressed with the addition to onStart()
in the recede()
function and using a non-negative duration value.
I'll give it a proper try when I'm back home again next week!
This PR fixes math in
MoveToEffect
so that negative progress did not reflect the direction of the delta offset vec.Corrected progress getter overload in
SequenceEffect
to correctly map to the progress when_index < 0
.Added
onStart()
inrecede()
initial condition so that effects likeMoveToEffect
can recalculate their initial data.Removed unnecessary math in
DurationEffectController
to avoid potential negative zeros.Introduced a new type
AlternatePattern
which allows users to include or exclude the last effect in the sequence when the pattern reverses. NOTE: When playing forward, the last effect isList.last
, but in reverse it isList.first
.Default value is now
AlternatePattern.repeatLast
.Made the TiledGame example project more aesthetically interesting.
AlternatePattern
feature along with all the new fixes.[x] I have followed the Contributor Guide when preparing my PR.
[ ] I have updated/added tests for ALL new/updated/fixed functionality.
[x] I have updated/added relevant documentation in
docs
and added dartdoc comments with///
.[x] I have updated/added relevant examples in
examples
ordocs
.TO DISCUSS
onEnd()
forEffect
s. Or provideonStart()
with an initialprogress
value to calculate from.Breaking Change?
Related Issues
I looked but didn't immediately see anyone reporting these issues. I discovered them myself.