mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-01 09:39:12 +08:00
MoveAlongPathEffect (#1172)
* MoveAlongPathEffect separated from MoveEffect * rename _lastPosition -> _lastOffset * Added absolute= flag in MoveAlongPathEffect * added test for absolute path * add oriented= flag * added test * changelog Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
This commit is contained in:
@ -89,14 +89,16 @@ class MoveEffectExample extends FlameGame {
|
||||
for (var i = 0; i < 40; i++) {
|
||||
add(
|
||||
CircleComponent(radius: 5)
|
||||
..position = Vector2(0, -1000)
|
||||
..add(
|
||||
MoveEffect.along(
|
||||
MoveAlongPathEffect(
|
||||
path1,
|
||||
EffectController(
|
||||
duration: 10,
|
||||
startDelay: i * 0.2,
|
||||
infinite: true,
|
||||
),
|
||||
absolute: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
@ -108,13 +110,14 @@ class MoveEffectExample extends FlameGame {
|
||||
RectangleComponent.square(size: 10)
|
||||
..paint = (Paint()..color = Colors.tealAccent)
|
||||
..add(
|
||||
MoveEffect.along(
|
||||
MoveAlongPathEffect(
|
||||
path2,
|
||||
EffectController(
|
||||
duration: 6,
|
||||
startDelay: i * 0.3,
|
||||
infinite: true,
|
||||
),
|
||||
oriented: true,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user