2012-03-22 101 views
0

的變化速度這是andengine- 我想,因爲它運行,就像一個自由運行遊戲像噴氣揹包兜風改變視差背景的速度autoparallaxbackgroundexample代碼..Andengine- autoparallaxbackground-背景

的鏈接的代碼是 - AutoParallaxBackgroundExample.java

在速度和背景的位置被設定爲 -

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值等個線在它,而在遊戲運行..固定的時間量之後遞增

回答

0

嘗試以下方法:

public void setParallaxChangePerSecond(final float pParallaxChangePerSecond)