Example #1
0
 public void tick(float dt)
 {
     this.currentPosition += dt * 1f / this.duration;
     if (this.currentPosition >= 1f)
     {
         this.currentPosition = 1f;
         this.currentState    = MoverHP.State.STOPPED;
     }
     this.setPosition();
 }
Example #2
0
 public bool startToFrom()
 {
     if (this.direction != -1)
     {
         this.direction       = -1;
         this.currentPosition = 0f;
         this.currentState    = MoverHP.State.RUNNING;
         return(true);
     }
     return(false);
 }
Example #3
0
 public bool startFromTo()
 {
     if (this.direction != 1)
     {
         this.direction = 1;
         this.currentPosition = 0f;
         this.currentState = MoverHP.State.RUNNING;
         return true;
     }
     return false;
 }
Example #4
0
 public void tick(float dt)
 {
     this.currentPosition += dt * 1f / this.duration;
     if (this.currentPosition >= 1f)
     {
         this.currentPosition = 1f;
         this.currentState = MoverHP.State.STOPPED;
     }
     this.setPosition();
 }