GreatBigBore Posted September 4, 2016 Share Posted September 4, 2016 I thought it would be obvious how to make this work, but it's not working. It goes one time, and then stops forever. I've re-read the doc on chaining and repeating ten times, and I've tried to follow through the tween code in the Phaser lib. I must be missing something obvious from looking at it too much. What am I doing wrong? this.midnightToSunup = game.add.tween(this.sunChariot).to( { x: - 100 }, 5000/*this.dayLength*/, Phaser.Easing.Sinusoidal.In ); this.sunupToNoon = game.add.tween(this.sunChariot).to( { x: game.width / 2 }, 5000/*this.dayLength*/, Phaser.Easing.Sinusoidal.In, false ); this.noonToSundown = game.add.tween(this.sunChariot).to( { x: game.width + 100 }, 5000/*this.dayLength*/, Phaser.Easing.Sinusoidal.In ); this.sundownToMidnight = game.add.tween(this.sunChariot).to( { x: game.width / 2 }, 5000/*this.dayLength*/, Phaser.Easing.Sinusoidal.In ); this.sunupToNoon.chain(this.noonToSundown, this.sundownToMidnight, this.midnightToSunup); this.sunupToNoon.repeat(-1); this.sunupToNoon.start(); Link to comment Share on other sites More sharing options...
GreatBigBore Posted September 4, 2016 Author Share Posted September 4, 2016 Turns out the loop() function works where repeat(-1) didn't. I guess I'm using repeat() wrong? Link to comment Share on other sites More sharing options...
Recommended Posts