Hello,
I tried to create a timeline that increments the x and y properties of an object and loops infinitely.
It works fine the first time but a problem comes after: the tweens keep using the initial position of the object as starting values.
So it makes something strange like:
Loop 1
x: 0 -> 100 / y: 0 -> 100
Loop 2
x: 0 -> 200 / y: 0 -> 200
Loop 3
x: 0 -> 300 / y: 0 -> 300
…
Here is an example that shows the problem: https://Phaserjs-Game-Starter.gyariab.repl.co
The source code is available here: https://repl.it/@GyariAb/Phaserjs-Game-Starter
The code of the timeline is:
var timeline = this.tweens.createTimeline();
timeline.add({
targets: image,
x: "+="+100,
ease: 'Power1',
duration: 1000
});
timeline.add({
targets: image,
y: "+="+100,
ease: 'Power1',
duration: 1000
});
timeline.loop = -1;
timeline.play();
Thanks