Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/198.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 我可以在安德林更平稳地移动雪碧吗?_Android_Sprite_Andengine - Fatal编程技术网

Android 我可以在安德林更平稳地移动雪碧吗?

Android 我可以在安德林更平稳地移动雪碧吗?,android,sprite,andengine,Android,Sprite,Andengine,这是我的密码 MainScene pScene; public ProgressBar(float pX, float pY, ITextureRegion pTextureRegion, VertexBufferObjectManager pVertexBufferObjectManager, MainScene pScene) { super(pX, pY, pTextureRegion, pVertexBufferObjectManager);

这是我的密码

MainScene pScene;
public ProgressBar(float pX, float pY, ITextureRegion pTextureRegion,
        VertexBufferObjectManager pVertexBufferObjectManager,
        MainScene pScene) {
    super(pX, pY, pTextureRegion, pVertexBufferObjectManager);
    this.pScene = pScene;
}

@Override
protected void onManagedUpdate(final float pSecondsElapsed){
    super.onManagedUpdate(pSecondsElapsed);
    this.mX += pScene.barSpeed;
    if(this.mX > 610){
        this.mX = 100;
    }
}
它运行得很好,但问题是当我使用这个代码时,一些精灵永远不会和这个条在同一个地方。(例如,当barSpeed为7时,(105,30)上的精灵永远无法满足此条要求)


我需要更平滑地移动这个精灵,这意味着它逐像素移动,所以这个精灵可以接触到所有精灵。而且这个条还必须有可以控制其速度的代码。

请输入更多代码。精灵会移动吗?你确定你的程序条可以在需要的地方吗?你是否考虑过没有检查雪碧的确切位置,而是在一定范围内?(100