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.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.Sprite;
import zero1hd.rhythmbullet.entity.Entity;
@ -17,7 +18,6 @@ public class VoidCircle extends Entity {
private float maxTime;
private Sound sound;
@Override
public void preInit() {
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);
} else {
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) {
@ -80,6 +80,10 @@ public class VoidCircle extends Entity {
super.act(delta);
}
@Override
public void draw(Batch batch, float parentAlpha) {
super.draw(batch, parentAlpha);
}
@Override
public void reset() {
@ -90,12 +94,16 @@ public class VoidCircle extends Entity {
endRadius = 0;
begin = false;
setSize(0, 0);
super.reset();
}
public void growCurrentRadius(float radius) {
currentRadius += radius;
float length = (float) Math.sqrt(2*(currentRadius*currentRadius));
if (length < 0) {
length = 0;
}
hitbox.setSize(length, length);
}

View File

@ -14,7 +14,7 @@ import com.badlogic.gdx.utils.Align;
public class GraphicsTable extends Table {
private Label resolutions, shaders;
private CheckBox glowShader, bgShader, invertShader;
private CheckBox glowShader, bgShader, invertShader, fancySpriteShader;
private SetResolutionButton
_3840x2160,
@ -50,6 +50,11 @@ public class GraphicsTable extends Table {
add(bgShader).minHeight(shaders.getHeight());
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);
add(resolutions).left();
row();
@ -109,5 +114,6 @@ public class GraphicsTable extends Table {
prefs.putBoolean("bg shader", bgShader.isChecked());
prefs.putBoolean("glow shader", glowShader.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 Thread mapGenThread;
private volatile GameScreen gameScreen;
private GameScreen gameScreen;
private RhythmBullet core;
@ -222,7 +222,6 @@ public class AnalyzePage extends Page implements MiniListener {
info[0].addAction(Actions.color(Color.BLACK, 2.5f));
}
@Override
public void act(float delta) {
super.act(delta);
@ -251,6 +250,7 @@ public class AnalyzePage extends Page implements MiniListener {
info[2].addAction(Actions.color(Color.BLACK, 0.75f));
confirmDiffButton.setDisabled(false);
}
info[0].setText("Initial analysis: " + audioAnalyzer.getProgress() + "%");
break;
case SPECTRAL_FLUX_DONE:

View File

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