flame-engine / flame

A Flutter based game engine.
https://flame-engine.org
MIT License
9.31k stars 915 forks source link

feat!: New `AlternatePattern` argument for `SequenceEffect` #3322

Open TheMaverickProgrammer opened 2 months ago

TheMaverickProgrammer commented 2 months ago

TO DISCUSS

  1. I have skipped the test checkbox until I had a review and we could discuss these changes.
  2. We may need to consider an onEnd() for Effects. Or provide onStart() with an initial progress value to calculate from.

Breaking Change?

Related Issues

I looked but didn't immediately see anyone reporting these issues. I discovered them myself.

TheMaverickProgrammer commented 3 weeks 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.

TheMaverickProgrammer commented 2 weeks ago

@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.

spydon commented 2 weeks ago

I'll give it a proper try when I'm back home again next week!