【发布时间】:2019-06-12 14:54:42
【问题描述】:
为什么 android 游戏在最强大的设备上最慢,但在标准设备上游戏正常,而在劣质设备上游戏速度很快(我的意思是游戏中的移动)。
我尝试将游戏对象速度乘以 delta 并尝试将 FPS 限制为 60f/s。
@Override
public void render(float delta) {
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
camera.update();
stage.act(Math.min(delta, 1 / 61f)); // At now i try with limit
stage.draw();
if (!isPaused && isAlive()) {
if (Gdx.input.getPressure() > 0) balloon.setDir(true);
else balloon.setDir(false);
updateLogic(Math.min(delta, 1 / 61f));
}
/// Its render.
if (getUser().getCurrentLocation().isPaused()) return;
float tempSpeed = speed * delta;
// Its velocity calculation;
【问题讨论】:
-
“强大”和“标准”是模糊的术语。
-
将速度乘以增量时间并将其用作游戏速度是没有意义的。将速度乘以增量时间可以得出当前帧的位移量。你用 tempSpeed 做什么?
-
我是指游戏中的速度对象,它们的移动速度