Jump to content

Stumped. Can't get a chain of tweens to repeat


Recommended Posts

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);


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...