@Override
  public void setup() {
    size(400, 100);
    smooth();

    Motion.setup(this);

    t = new Tween(this, "w", width, 100f).repeat().play();
  }
示例#2
0
 public void update() {
   if (isInMotion()) {
     Set<Motion> toRemove = new HashSet<Motion>();
     for (Motion m : tweens) {
       if (!m.isPlaying()) {
         if (m.getPosition() == 0) {
           m.play();
         } else {
           toRemove.add(m);
         }
       } else {
         m.update();
       }
     }
     for (Motion m : toRemove) {
       tweens.remove(m);
     }
   }
 }