fixed minor issues in creative screen

This commit is contained in:
Harrison Deng 2017-08-11 01:14:25 -05:00
parent 2e5c1064ac
commit d92af2b964
4 changed files with 14 additions and 10 deletions

View File

@ -32,6 +32,7 @@ public class Flake extends Entity {
shards[i].init(x, y, 360/shards.length*i, 0, 2); shards[i].init(x, y, 360/shards.length*i, 0, 2);
ec.getStage().addActor(shards[i]); ec.getStage().addActor(shards[i]);
} }
this.speed = rate; this.speed = rate;
this.timer = fuse; this.timer = fuse;
this.totalTime = fuse; this.totalTime = fuse;

View File

@ -44,9 +44,7 @@ public class Pellet extends Entity implements Poolable {
@Override @Override
public void collided(Entity entity) { public void collided(Entity entity) {
if (entity.getClass() == PolyjetEntity.class) {
dead = true; dead = true;
}
super.collided(entity); super.collided(entity);
} }

View File

@ -135,6 +135,7 @@ public class GamePlayArea extends Stage {
if (currentSpawnInfo[i].getEntityCoordinator() != null) { if (currentSpawnInfo[i].getEntityCoordinator() != null) {
entity.setCoordinator(currentSpawnInfo[i].getEntityCoordinator().buildCoordinator()); entity.setCoordinator(currentSpawnInfo[i].getEntityCoordinator().buildCoordinator());
} }
entity.init(currentSpawnInfo[i].parameters); entity.init(currentSpawnInfo[i].parameters);
addActor(entity); addActor(entity);
} }

View File

@ -1,6 +1,8 @@
package zero1hd.rhythmbullet.ui.windows; package zero1hd.rhythmbullet.ui.windows;
import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.Input.Keys;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.audio.Music.OnCompletionListener;
import com.badlogic.gdx.math.MathUtils; import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputEvent;
@ -15,7 +17,7 @@ import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import zero1hd.rhythmbullet.audio.AudioData; import zero1hd.rhythmbullet.audio.AudioData;
public class MusicController extends Window { public class MusicController extends Window implements OnCompletionListener {
Skin skin; Skin skin;
private Image togglePlay; private Image togglePlay;
private TextField info; private TextField info;
@ -57,12 +59,8 @@ public class MusicController extends Window {
togglePlay.setDrawable(skin.getDrawable("arrow")); togglePlay.setDrawable(skin.getDrawable("arrow"));
} else { } else {
try {
togglePlay.setDrawable(skin.getDrawable("pause")); togglePlay.setDrawable(skin.getDrawable("pause"));
audiofile.getPlaybackMusic().play(); audiofile.getPlaybackMusic().play();
} catch (NullPointerException e) {
e.printStackTrace();
}
} }
} }
super.clicked(event, x, y); super.clicked(event, x, y);
@ -129,4 +127,10 @@ public class MusicController extends Window {
public AudioData getAudiofile() { public AudioData getAudiofile() {
return audiofile; return audiofile;
} }
@Override
public void onCompletion(Music music) {
audiofile.dispose();
audiofile = null;
}
} }