/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package projectfun.sprite;

import javafx.scene.Scene;

/** Controls a AbstractSprite and its movement
X
 * @author Nathan
 */
public abstract class SpriteController {
    public abstract Scene getScene();
    public abstract AbstractSprite getSprite();
    public void move(double x,double y,double z){
        this.getSprite().setTranslateX(x);
        this.getSprite().setTranslateY(y);
        this.getSprite().setTranslateZ(z);
    }
    private Timer Glider=new Timer("Sprite Glider");
    public void glide(double x,double y,double z,double buffer,long time){
        Glider.scheduleAtFixedRate(mover(x, y, z, buffer, time), 0, time);
    }
    TimerTask mover(double x,double y,double z,double buffer,double time){
        return new TimerTask() {

            @Override
            public void run() {
                move(x, y, z);
            }
        };
    }
}

@@ -760,32 +760,54 @@
 er,long time)%7B%0D%0A
+        int count=0;%0D%0A
         Glider.s
@@ -852,16 +852,23 @@
 er, time
+, count
 ), 0, ti
@@ -869,24 +869,193 @@
  0, time);%0D%0A
+        Glider.schedule(new TimerTask() %7B%0D%0A%0D%0A            @Override%0D%0A            public void run() %7B%0D%0A                Glider.cancel();%0D%0A            %7D%0D%0A        %7D, time);%0D%0A
     %7D%0D%0A    T
@@ -1117,24 +1117,34 @@
 ,double time
+,int count
 )%7B%0D%0A        
@@ -1219,32 +1219,72 @@
 c void run() %7B%0D%0A
+                double d =time/buffer;%0D%0A
                 
@@ -1289,22 +1289,28 @@
   move(x
+/d
 , y
+/d
 , z
+/d
 );%0D%0A    

Update SpriteController.java