Back to project page X3n0break.
The source code is released under:
GNU General Public License
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.
package org.x3n0m0rph59.breakout; /*from ww w.ja v a 2 s . com*/ import java.io.Serializable; import com.badlogic.gdx.graphics.GL20; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; public class BottomWall implements Stepable, Renderable, Serializable { /** * */ private static final long serialVersionUID = 1144551017184114286L; private int frameCounter = 0; boolean drawFlash = false; @Override public void render(SpriteBatch batch) { BitmapFont f = FontLoader.getInstance().getFont("font", 44); final float segment_width = f.getBounds("-").width; //Config.BOTTOM_WALL_SEGMENT_WIDTH final float segment_height = f.getLineHeight() - 25.0f; //Config.BOTTOM_WALL_SEGMENT_HEIGHT for (int i = 0; i <= Config.getInstance().getClientWidth() / (segment_width + Config.BOTTOM_WALL_SEGMENT_SPACING); i++) { float x = i * (segment_width + Config.BOTTOM_WALL_SEGMENT_SPACING); float y = Config.WORLD_HEIGHT - segment_height; final boolean inGracePeriod = EffectManager.getInstance().isEffectInGracePeriod(Effect.Type.BOTTOM_WALL); batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA); if (inGracePeriod && drawFlash) f.draw(batch, " ", x, y); else f.draw(batch, "-", x, y); } } @Override public void step(float delta) { if ((frameCounter % (Config.SYNC_FPS * Config.GRACE_PERIOD_BLINK_RATE)) == 0) drawFlash = !drawFlash; frameCounter++; } }