// Path: src/main/java/com/pesegato/MonkeySheet/MSControl.java
// public class MSControl extends MSSpriteControl {
// 
//     boolean runOnce = false;
//     MSAnimationManager animManager;
//     public MSAction msAction;
// 
//     public MSControl() {
//     }
// 
//     public MSControl(String anim, Timeable timeable) {
//         playForever(anim);
//         MonkeySheetAppState.timeable = timeable;
//     }
// 
//     public MSControl(MSAnimationManager animManager) {
//         this.animManager = animManager;
//     }
// 
//     final public void playForever(String ani) {
//         anim = MonkeySheetAppState.getAnim(ani);
//         position = 0;
//         runOnce = false;
//         if (anim == null) {
//             log.warn("Running UNINITIALIZED animation {}, GOING TO CRASH VERY SOON!!!", ani);
//             return;
//         }
//         animation = ani;
//         log.debug("now playing FOREVER animation {}/{}", anim.msCont.name, ani);
//     }
// 
//     public void playOnce(String ani) {
//         anim = MonkeySheetAppState.getAnim(ani);
//         position = 0;
//         runOnce = true;
//         if (anim == null) {
//             log.warn("Running UNINITIALIZED animation {}, GOING TO CRASH VERY SOON!!!" + ani);
//             return;
//         }
//         animation = ani;
//         log.debug("now playing ONCE animation {}/{}", anim.msCont.name, ani);
//     }
// 
//     @Override
//     protected void controlUpdate(float tpf) {
//         if (MonkeySheetAppState.tTPF == 0) {
//             log.trace("position: {}/{} {} - {}", anim.msCont.name, animation, position, anim.anim[position].position);
//             if (position < anim.anim.length - 1) {
//                 position++;
//             } else if (runOnce) {
//                 if (animManager != null) {
//                     log.trace("loading animManager {}", animManager);
//                     animManager.whatPlay(this);
//                 }
//                 if (msAction != null) {
//                     log.trace("end of MSAction {}", msAction);
//                     msAction.terminatedAnim();
//                     msAction.whatPlay(this);
//                 }
//             } else {
//                 position = 0;
//             }
//         }
// 
//     }
// 
//     public int getCurrentHitbox() {
//         return anim.hitbox[position];
//     }
// 
//     @Override
//     protected void controlRender(RenderManager rm, ViewPort vp) {
//     }
// 
// }
// 
// Path: src/main/java/com/pesegato/MonkeySheet/MSGlobals.java
// public static final int SPRITE_SIZE = 256;


import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Quad;
import com.pesegato.MonkeySheet.MSControl;
import static com.pesegato.MonkeySheet.MSGlobals.SPRITE_SIZE;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
     * @deprecated use Sprite or Pixels
     */

    protected boolean moveFixX(float x, float finalX){
        finalX=finalX*SPRITE_SIZE;
        float currentX=spatial.getLocalTranslation().x;
        float currentY=spatial.getLocalTranslation().y;
        float nextX=SPRITE_SIZE * x + currentX;
        if (x>0){
            nextX=Math.min(nextX, finalX);
        }
        else {
            nextX=Math.max(nextX, finalX);
        }
        spatial.setLocalTranslation(nextX,currentY,0);
        return nextX==finalX;
    }

    /**
     * This method moves the spatial toward absolute target position finalX
     * with speed factors x.
     * If speed is positive but target is behind then no movement is performed
     * If speed is negative but target is in front then no movement is performed
     *
     * @param x      speed on the X
     * @param finalX target x coordinate
     * @return true if arrived at target position
     */

    protected boolean moveFixXSprite(float x, float finalX) {
// Path: src/main/java/com/pesegato/MonkeySheet/MSControl.java
// public class MSControl extends MSSpriteControl {
// 
//     boolean runOnce = false;
//     MSAnimationManager animManager;
//     public MSAction msAction;
// 
//     public MSControl() {
//     }
// 
//     public MSControl(String anim, Timeable timeable) {
//         playForever(anim);
//         MonkeySheetAppState.timeable = timeable;
//     }
// 
//     public MSControl(MSAnimationManager animManager) {
//         this.animManager = animManager;
//     }
// 
//     final public void playForever(String ani) {
//         anim = MonkeySheetAppState.getAnim(ani);
//         position = 0;
//         runOnce = false;
//         if (anim == null) {
//             log.warn("Running UNINITIALIZED animation {}, GOING TO CRASH VERY SOON!!!", ani);
//             return;
//         }
//         animation = ani;
//         log.debug("now playing FOREVER animation {}/{}", anim.msCont.name, ani);
//     }
// 
//     public void playOnce(String ani) {
//         anim = MonkeySheetAppState.getAnim(ani);
//         position = 0;
//         runOnce = true;
//         if (anim == null) {
//             log.warn("Running UNINITIALIZED animation {}, GOING TO CRASH VERY SOON!!!" + ani);
//             return;
//         }
//         animation = ani;
//         log.debug("now playing ONCE animation {}/{}", anim.msCont.name, ani);
//     }
// 
//     @Override
//     protected void controlUpdate(float tpf) {
//         if (MonkeySheetAppState.tTPF == 0) {
//             log.trace("position: {}/{} {} - {}", anim.msCont.name, animation, position, anim.anim[position].position);
//             if (position < anim.anim.length - 1) {
//                 position++;
//             } else if (runOnce) {
//                 if (animManager != null) {
//                     log.trace("loading animManager {}", animManager);
//                     animManager.whatPlay(this);
//                 }
//                 if (msAction != null) {
//                     log.trace("end of MSAction {}", msAction);
//                     msAction.terminatedAnim();
//                     msAction.whatPlay(this);
//                 }
//             } else {
//                 position = 0;
//             }
//         }
// 
//     }
// 
//     public int getCurrentHitbox() {
//         return anim.hitbox[position];
//     }
// 
//     @Override
//     protected void controlRender(RenderManager rm, ViewPort vp) {
//     }
// 
// }
// 
// Path: src/main/java/com/pesegato/MonkeySheet/MSGlobals.java
// public static final int SPRITE_SIZE = 256;


// Path: src/main/java/com/pesegato/MonkeySheet/actions/MSAction.java
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Quad;
import com.pesegato.MonkeySheet.MSControl;
import static com.pesegato.MonkeySheet.MSGlobals.SPRITE_SIZE;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

     * @deprecated use Sprite or Pixels
     */

    protected boolean moveFixX(float x, float finalX){
        finalX=finalX*SPRITE_SIZE;
        float currentX=spatial.getLocalTranslation().x;
        float currentY=spatial.getLocalTranslation().y;
        float nextX=SPRITE_SIZE * x + currentX;
        if (x>0){
            nextX=Math.min(nextX, finalX);
        }
        else {
            nextX=Math.max(nextX, finalX);
        }
        spatial.setLocalTranslation(nextX,currentY,0);
        return nextX==finalX;
    }

    /**
     * This method moves the spatial toward absolute target position finalX
     * with speed factors x.
     * If speed is positive but target is behind then no movement is performed
     * If speed is negative but target is in front then no movement is performed
     *
     * @param x      speed on the X
     * @param finalX target x coordinate
     * @return true if arrived at target position
     */

    protected boolean moveFixXSprite(float x, float finalX) {
        finalX = finalX * SPRITE_SIZE;