mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-17 05:07:46 +08:00
Remove unnecessary part from SequenceEffect update
This commit is contained in:
@@ -76,7 +76,7 @@ class MyGame extends BaseGame with TapDetector {
|
|||||||
);
|
);
|
||||||
|
|
||||||
final sequence = SequenceEffect(
|
final sequence = SequenceEffect(
|
||||||
effects: [move1, scale, move2],
|
effects: [move1, scale, combination],
|
||||||
isInfinite: false,
|
isInfinite: false,
|
||||||
isAlternating: true,
|
isAlternating: true,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -69,14 +69,6 @@ class SequenceEffect extends PositionComponentEffect {
|
|||||||
if (currentEffect.hasFinished()) {
|
if (currentEffect.hasFinished()) {
|
||||||
_driftModifier = currentEffect.driftTime;
|
_driftModifier = currentEffect.driftTime;
|
||||||
_currentIndex++;
|
_currentIndex++;
|
||||||
final iterationSize = isAlternating ? effects.length * 2 : effects.length;
|
|
||||||
if (_currentIndex != 0 &&
|
|
||||||
_currentIndex == iterationSize &&
|
|
||||||
(currentEffect.isAlternating ||
|
|
||||||
currentEffect.isAlternating == isAlternating)) {
|
|
||||||
isInfinite ? reset() : dispose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final orderedEffects =
|
final orderedEffects =
|
||||||
curveDirection.isNegative ? effects.reversed.toList() : effects;
|
curveDirection.isNegative ? effects.reversed.toList() : effects;
|
||||||
// Make sure the current effect has the `isAlternating` value it
|
// Make sure the current effect has the `isAlternating` value it
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ void main() {
|
|||||||
RotateEffect effect({bool isInfinite = false, bool isAlternating = false}) {
|
RotateEffect effect({bool isInfinite = false, bool isAlternating = false}) {
|
||||||
return RotateEffect(
|
return RotateEffect(
|
||||||
angle: angleArgument,
|
angle: angleArgument,
|
||||||
duration: 1 + random.nextInt(100).toDouble(),
|
duration: 1 + random.nextInt(5).toDouble(),
|
||||||
isInfinite: isInfinite,
|
isInfinite: isInfinite,
|
||||||
isAlternating: isAlternating,
|
isAlternating: isAlternating,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user