mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 20:13:50 +08:00
Formatting
This commit is contained in:
committed by
Lukas Klingsbo
parent
18048b16a3
commit
eb70fe72d8
@ -35,7 +35,7 @@ abstract class PositionComponentEffect {
|
||||
Vector2 originalPosition;
|
||||
double originalAngle;
|
||||
Vector2 originalSize;
|
||||
|
||||
|
||||
/// Used to be able to determine the end state of a sequence of effects
|
||||
Vector2 endPosition;
|
||||
double endAngle;
|
||||
|
||||
@ -52,7 +52,7 @@ class MoveEffect extends PositionComponentEffect {
|
||||
if (isRelative) {
|
||||
Vector2 lastPosition = _startPosition;
|
||||
_movePath = [];
|
||||
for(Vector2 v in path) {
|
||||
for (Vector2 v in path) {
|
||||
final nextPosition = v + lastPosition;
|
||||
_movePath.add(nextPosition);
|
||||
lastPosition = nextPosition;
|
||||
@ -92,11 +92,11 @@ class MoveEffect extends PositionComponentEffect {
|
||||
}
|
||||
travelTime = pathLength / speed;
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void reset() {
|
||||
super.reset();
|
||||
if(_percentagePath?.isNotEmpty ?? false) {
|
||||
if (_percentagePath?.isNotEmpty ?? false) {
|
||||
_currentSubPath = _percentagePath.first;
|
||||
}
|
||||
}
|
||||
@ -117,7 +117,6 @@ class MoveEffect extends PositionComponentEffect {
|
||||
final double localPercentage =
|
||||
(progress - lastEndAt) / (_currentSubPath.endAt - lastEndAt);
|
||||
component.position = _currentSubPath.previous +
|
||||
((_currentSubPath.v - _currentSubPath.previous) *
|
||||
localPercentage);
|
||||
((_currentSubPath.v - _currentSubPath.previous) * localPercentage);
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,9 +63,9 @@ class SequenceEffect extends PositionComponentEffect {
|
||||
_driftModifier = currentEffect.driftTime;
|
||||
_currentIndex++;
|
||||
final iterationSize = isAlternating ? effects.length * 2 : effects.length;
|
||||
if (_currentIndex != 0
|
||||
&& _currentIndex == iterationSize
|
||||
&& (currentEffect.isAlternating ||
|
||||
if (_currentIndex != 0 &&
|
||||
_currentIndex == iterationSize &&
|
||||
(currentEffect.isAlternating ||
|
||||
currentEffect.isAlternating == isAlternating)) {
|
||||
isInfinite ? reset() : dispose();
|
||||
return;
|
||||
@ -93,7 +93,7 @@ class SequenceEffect extends PositionComponentEffect {
|
||||
void reset() {
|
||||
super.reset();
|
||||
effects.forEach((e) => e.reset());
|
||||
if(component != null) {
|
||||
if (component != null) {
|
||||
component.position = originalPosition;
|
||||
component.angle = originalAngle;
|
||||
component.size = originalSize;
|
||||
|
||||
Reference in New Issue
Block a user