Back to project page ninja-trials.
The source code is released under:
Apache License
If you think the Android project ninja-trials listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.madgear.ninjatrials.utils; //ww w. ja va 2 s. com public class AutoDiagonalParallaxBackground extends ParallaxBackground2d { // =========================================================== // Constants // =========================================================== // =========================================================== // Fields // =========================================================== private final float mParallaxChangePerSecond; // =========================================================== // Constructors // =========================================================== public AutoDiagonalParallaxBackground (final float pRed, final float pGreen, final float pBlue, final float pParallaxChangePerSecond) { super(pRed, pGreen, pBlue); this.mParallaxChangePerSecond = pParallaxChangePerSecond; } // =========================================================== // Getter & Setter // =========================================================== // =========================================================== // Methods for/from SuperClass/Interfaces // =========================================================== @Override public void onUpdate(final float pSecondsElapsed) { super.onUpdate(pSecondsElapsed); this.mParallaxValueY += this.mParallaxChangePerSecond * pSecondsElapsed; this.mParallaxValueX += this.mParallaxChangePerSecond * pSecondsElapsed; } // =========================================================== // Methods // =========================================================== // =========================================================== // Inner and Anonymous Classes // =========================================================== }