Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.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 Andengine-自动平行背景-背景变化速度_Android_Andengine - Fatal编程技术网

Android Andengine-自动平行背景-背景变化速度

Android Andengine-自动平行背景-背景变化速度,android,andengine,Android,Andengine,这是andengine的AutoParallaxBackground示例代码- 我想改变视差背景在运行时的速度,比如像jetpack joyride这样的自由跑游戏 代码的链接是- 设置背景速度和位置的行为- autoParallaxBackground.attachParallaxEntity(new ParallaxEntity(0.0f, new Sprite(0, CAMERA_HEIGHT - this.mParallaxLayerBack.getHeight(), this.mPa

这是andengine的AutoParallaxBackground示例代码- 我想改变视差背景在运行时的速度,比如像jetpack joyride这样的自由跑游戏

代码的链接是-

设置背景速度和位置的行为-

autoParallaxBackground.attachParallaxEntity(new ParallaxEntity(0.0f, new Sprite(0, CAMERA_HEIGHT - this.mParallaxLayerBack.getHeight(), this.mParallaxLayerBack)));
            autoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-5.0f, new Sprite(0, 80, this.mParallaxLayerMid)));
            autoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-10.0f, new Sprite(0, CAMERA_HEIGHT - this.mParallaxLayerFront.getHeight(), this.mParallaxLayerFront)));
            scene.setBackground(autoParallaxBackground);

我需要更改-5.0f值,使其在游戏运行时在固定时间后递增。

尝试以下方法:

public void setParallaxChangePerSecond(final float pParallaxChangePerSecond)