This commit is contained in:
Harrison Deng 2017-07-16 14:25:03 -05:00
parent 8bcea5cfff
commit a02e5565ff
6 changed files with 20 additions and 13 deletions

View File

@ -29,6 +29,10 @@ public class GamePlayMap {
return musicData.getPlaybackMusic(); return musicData.getPlaybackMusic();
} }
public AudioData getMusicData() {
return musicData;
}
/** /**
* returns the runtime time of the overall song * returns the runtime time of the overall song
* @return * @return

View File

@ -22,7 +22,7 @@ public class VoidCircle extends Actor implements Entity, Poolable {
private boolean done; private boolean done;
private boolean begin; private boolean begin;
private Vector2 center; private Vector2 center;
private float maxTime;
public VoidCircle(Texture voidTexture) { public VoidCircle(Texture voidTexture) {
hitBox = new Rectangle(); hitBox = new Rectangle();
center = new Vector2(); center = new Vector2();
@ -31,6 +31,7 @@ public VoidCircle(Texture voidTexture) {
public void init(float endRadius, float x, float y, float growthRate, float warningTime) { public void init(float endRadius, float x, float y, float growthRate, float warningTime) {
timer = warningTime; timer = warningTime;
maxTime = warningTime;
this.endRadius = endRadius; this.endRadius = endRadius;
setSize(2f*endRadius, 2f*endRadius); setSize(2f*endRadius, 2f*endRadius);
center.set(getWidth()/2f, getHeight()/2f); center.set(getWidth()/2f, getHeight()/2f);
@ -46,7 +47,7 @@ public VoidCircle(Texture voidTexture) {
voidCircleTexture.setColor(0f,0f,0f,1f); voidCircleTexture.setColor(0f,0f,0f,1f);
} else { } else {
voidCircleTexture.setSize(2*endRadius, 2*endRadius); voidCircleTexture.setSize(2*endRadius, 2*endRadius);
voidCircleTexture.setColor(1f,1f,1f,0.1f); voidCircleTexture.setColor(1f,1f,1f,0.1f*(timer/maxTime));
} }
hitBox.setCenter(getX()+center.x, getY()+center.y); hitBox.setCenter(getX()+center.x, getY()+center.y);
@ -83,6 +84,7 @@ public VoidCircle(Texture voidTexture) {
currentRadius = 0; currentRadius = 0;
growthRate = 0; growthRate = 0;
timer = 0; timer = 0;
maxTime = 0;
endRadius = 0; endRadius = 0;
done = false; done = false;
begin = false; begin = false;

View File

@ -130,7 +130,6 @@ public class GameScreen extends ScreenAdapter implements InputProcessor {
overlay.getViewport().apply(); overlay.getViewport().apply();
overlay.draw(); overlay.draw();
if (!paused) { if (!paused) {
music.readIndexUpdate();
scoreLabel.setText("Score: " + gameArea.getScore()); scoreLabel.setText("Score: " + gameArea.getScore());
gameArea.act(delta); gameArea.act(delta);

View File

@ -46,8 +46,8 @@ public class AudioGraph extends Actor {
scale -= 0.25f; scale -= 0.25f;
} }
} else if (Gdx.input.isKeyPressed(Keys.PERIOD)) { } else if (Gdx.input.isKeyPressed(Keys.PERIOD)) {
if (scale < audioGraph.getHeight()+30f) { if (scale < audioGraph.getHeight()*2f) {
scale += 0.25f; scale += 0.4f;
} }
} }
if (Gdx.input.isKeyJustPressed(Keys.M)) { if (Gdx.input.isKeyJustPressed(Keys.M)) {

View File

@ -212,9 +212,6 @@ public class CreativeStage extends Stage implements MiniListener {
@Override @Override
public void act(float delta) { public void act(float delta) {
if (musicPlayBackControls.getAudiofile() != null) {
musicPlayBackControls.getAudiofile().readIndexUpdate();
}
super.act(delta); super.act(delta);
} }

View File

@ -117,7 +117,10 @@ public class GamePlayArea extends Stage {
@Override @Override
public void act(float delta) { public void act(float delta) {
MapWindowData mwd; MapWindowData mwd;
if (audioMap != null && audioMap.getPlayableClip().isPlaying() && (mwd = audioMap.nextWindowData()) != null) { if (audioMap != null && audioMap.getPlayableClip().isPlaying()) {
audioMap.getMusicData().readIndexUpdate();
time = audioMap.getPlayableClip().getPosition();
if ((mwd = audioMap.nextWindowData()) != null) {
EntitySpawnInfo[] currentSpawnInfo = mwd.getArray(); EntitySpawnInfo[] currentSpawnInfo = mwd.getArray();
if (currentSpawnInfo != null) { if (currentSpawnInfo != null) {
for (int i = 0; i < currentSpawnInfo.length; i++) { for (int i = 0; i < currentSpawnInfo.length; i++) {
@ -125,6 +128,8 @@ public class GamePlayArea extends Stage {
} }
} }
} }
}
collisionDetector.collisionCheck(); collisionDetector.collisionCheck();
ec.deathClean(); ec.deathClean();