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