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);
ec.getStage().addActor(shards[i]);
}
this.speed = rate;
this.timer = fuse;
this.totalTime = fuse;

View File

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

View File

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

View File

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