If you think the Android project X3n0break listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package org.x3n0m0rph59.breakout;
//fromwww.java2s.com//import com.badlogic.gdx.graphics.g2d.SpriteBatch;
/**
* A background sprite that scrolls through the scene from top to bottom at a constant speed
* @author user
*/publicclass Background extends GameObject {
/**
*
*/privatestaticfinallong serialVersionUID = -4983875169579795137L;
/**
* Create a new Background
*
* @param sprite The Sprite used to draw the background
* @param position The initial position
* @param width The initial width
* @param height The initial height
* @param angle The initial angle of rotation in radians
* @param speed The initial scroll speed
*/public Background(SpriteObject sprite, Point position, float width, float height, float angle, float deltaY) {
super(sprite, position, width, height, angle, 0.0f, 0.0f, deltaY);
getSprite().setAlpha(Config.BACKGROUND_ALPHA);
}
// @Override
// public void render(SpriteBatch batch) {
// batch.disableBlending();
//
// super.render(batch);
//
// batch.enableBlending();
// }
/**
* Step one frame forward, animate our sprite and advance our
* position by speed units
*/
@Override
publicvoid step(float delta) {
super.step(delta);
if (getBoundingBox().getY() - getHeight() >= Config.getInstance().getScreenHeight())
setDestroyed(true);
}
}