fixed some graphical glitches and progressed on point and hp systems

This commit is contained in:
Harrison Deng 2017-08-05 02:30:19 -05:00
parent 63a2bd6b95
commit 47c1e596d2
4 changed files with 23 additions and 9 deletions

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import com.badlogic.gdx.audio.Sound; import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.Sprite; import com.badlogic.gdx.graphics.g2d.Sprite;
import zero1hd.rhythmbullet.entity.Entity; import zero1hd.rhythmbullet.entity.Entity;
@ -17,7 +18,6 @@ public class VoidCircle extends Entity {
private float maxTime; private float maxTime;
private Sound sound; private Sound sound;
@Override @Override
public void preInit() { public void preInit() {
sprite = new Sprite(assets.get("void_circle.png", Texture.class)); sprite = new Sprite(assets.get("void_circle.png", Texture.class));
@ -59,7 +59,7 @@ public class VoidCircle extends Entity {
sprite.setColor(0f,0f,0f,1f); sprite.setColor(0f,0f,0f,1f);
} else { } else {
sprite.setSize(2*endRadius, 2*endRadius); sprite.setSize(2*endRadius, 2*endRadius);
sprite.setColor(1f,1f,1f,0.1f*(timer/maxTime)); sprite.setColor(1f,0.52f,0.32f,0.1f*(timer/maxTime));
} }
if (timer > 0) { if (timer > 0) {
@ -80,6 +80,10 @@ public class VoidCircle extends Entity {
super.act(delta); super.act(delta);
} }
@Override
public void draw(Batch batch, float parentAlpha) {
super.draw(batch, parentAlpha);
}
@Override @Override
public void reset() { public void reset() {
@ -90,12 +94,16 @@ public class VoidCircle extends Entity {
endRadius = 0; endRadius = 0;
begin = false; begin = false;
setSize(0, 0); setSize(0, 0);
super.reset(); super.reset();
} }
public void growCurrentRadius(float radius) { public void growCurrentRadius(float radius) {
currentRadius += radius; currentRadius += radius;
float length = (float) Math.sqrt(2*(currentRadius*currentRadius)); float length = (float) Math.sqrt(2*(currentRadius*currentRadius));
if (length < 0) {
length = 0;
}
hitbox.setSize(length, length); hitbox.setSize(length, length);
} }

View File

@ -14,7 +14,7 @@ import com.badlogic.gdx.utils.Align;
public class GraphicsTable extends Table { public class GraphicsTable extends Table {
private Label resolutions, shaders; private Label resolutions, shaders;
private CheckBox glowShader, bgShader, invertShader; private CheckBox glowShader, bgShader, invertShader, fancySpriteShader;
private SetResolutionButton private SetResolutionButton
_3840x2160, _3840x2160,
@ -50,6 +50,11 @@ public class GraphicsTable extends Table {
add(bgShader).minHeight(shaders.getHeight()); add(bgShader).minHeight(shaders.getHeight());
row(); row();
fancySpriteShader = new CheckBox(" Fancy Sprites", skin, "expandable");
fancySpriteShader.setChecked(pref.getBoolean("fancy", true));
add(fancySpriteShader).minHeight(shaders.getHeight());
row();
resolutions = new Label("Optimized Resolutions", skin); resolutions = new Label("Optimized Resolutions", skin);
add(resolutions).left(); add(resolutions).left();
row(); row();
@ -109,5 +114,6 @@ public class GraphicsTable extends Table {
prefs.putBoolean("bg shader", bgShader.isChecked()); prefs.putBoolean("bg shader", bgShader.isChecked());
prefs.putBoolean("glow shader", glowShader.isChecked()); prefs.putBoolean("glow shader", glowShader.isChecked());
prefs.putBoolean("invert shader", invertShader.isChecked()); prefs.putBoolean("invert shader", invertShader.isChecked());
prefs.putBoolean("fancy", fancySpriteShader.isChecked());
} }
} }

View File

@ -57,7 +57,7 @@ public class AnalyzePage extends Page implements MiniListener {
private long startTime, endTime; private long startTime, endTime;
private Thread mapGenThread; private Thread mapGenThread;
private volatile GameScreen gameScreen; private GameScreen gameScreen;
private RhythmBullet core; private RhythmBullet core;
@ -222,7 +222,6 @@ public class AnalyzePage extends Page implements MiniListener {
info[0].addAction(Actions.color(Color.BLACK, 2.5f)); info[0].addAction(Actions.color(Color.BLACK, 2.5f));
} }
@Override @Override
public void act(float delta) { public void act(float delta) {
super.act(delta); super.act(delta);
@ -251,6 +250,7 @@ public class AnalyzePage extends Page implements MiniListener {
info[2].addAction(Actions.color(Color.BLACK, 0.75f)); info[2].addAction(Actions.color(Color.BLACK, 0.75f));
confirmDiffButton.setDisabled(false); confirmDiffButton.setDisabled(false);
} }
info[0].setText("Initial analysis: " + audioAnalyzer.getProgress() + "%"); info[0].setText("Initial analysis: " + audioAnalyzer.getProgress() + "%");
break; break;
case SPECTRAL_FLUX_DONE: case SPECTRAL_FLUX_DONE:

View File

@ -3,23 +3,23 @@ package zero1hd.rhythmbullet.util;
import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Array;
public class MiniSender { public class MiniSender {
private Array<MiniListener> listeners; private volatile Array<MiniListener> listeners;
public MiniSender() { public MiniSender() {
listeners = new Array<MiniListener>(); listeners = new Array<MiniListener>();
} }
public void send(MiniEvents ID) { public synchronized void send(MiniEvents ID) {
for (MiniListener listener : listeners) { for (MiniListener listener : listeners) {
listener.handle(ID); listener.handle(ID);
} }
} }
public void addListener(MiniListener handler) { public synchronized void addListener(MiniListener handler) {
listeners.add(handler); listeners.add(handler);
} }
public void removeListener(MiniListener listener) { public synchronized void removeListener(MiniListener listener) {
listeners.removeValue(listener, true); listeners.removeValue(listener, true);
} }
} }